:root {
  color-scheme: dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #090b0d;
  color: #f1f4f2;
  --panel: #101417;
  --panel-soft: #0d1114;
  --line: #28302d;
  --muted: #84908a;
  --green: #36d475;
  --green-bright: #63ee98;
  --empty: #242b29;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #090b0d; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, rgba(54, 212, 117, .1), transparent 34rem), #090b0d; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { width: min(1180px, calc(100% - 40px)); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #202623; }
.brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; letter-spacing: -.03em; }
.brand strong { font-size: 18px; }
.brand-mark { width: 26px; height: 26px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; transform: rotate(-4deg); }
.brand-mark i { display: block; background: #26302b; border: 1px solid #39443f; border-radius: 2px; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(4) { background: var(--green); border-color: var(--green-bright); box-shadow: 0 0 12px rgba(54, 212, 117, .22); }
.year-chip { color: var(--muted); font-size: 11px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; }
main { flex: 1; }

.setup-view { min-height: calc(100vh - 140px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 80px; align-items: center; padding: 80px 0; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 11px; letter-spacing: .16em; font-weight: 700; }
.eyebrow > span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 2px; background: var(--green); box-shadow: 0 0 10px rgba(54, 212, 117, .55); }
.eyebrow.muted { color: #78847e; }
.setup-copy h1 { margin: 0; max-width: 780px; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(42px, 6vw, 72px); line-height: 1.05; letter-spacing: -.055em; }
.setup-copy h1 em { color: var(--green); font-style: normal; }
.setup-copy > p:last-child { max-width: 590px; margin: 28px 0 0; color: #9ca6a1; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.8; }
.setup-card { padding: 30px; background: linear-gradient(180deg, #121714, #0d1110); border: 1px solid #303a35; border-radius: 10px; box-shadow: 0 22px 70px rgba(0, 0, 0, .35); }
.setup-card label { display: block; margin-bottom: 12px; color: #a9b3ae; font-size: 12px; }
.setup-card input { width: 100%; height: 54px; padding: 0 15px; color: #f2f5f3; background: #090c0b; border: 1px solid #38433e; border-radius: 6px; outline: none; }
.setup-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(54, 212, 117, .12); }
.setup-card button, .today-card button { width: 100%; min-height: 52px; margin-top: 14px; color: #06130b; background: var(--green); border: 1px solid var(--green-bright); border-radius: 6px; font-weight: 800; }
.setup-card button:hover, .today-card button:hover { background: var(--green-bright); }
.setup-card button span { float: right; }
.setup-card small { display: block; margin-top: 13px; color: #68736e; font-size: 10px; text-align: center; }

.tracker-view { padding: 64px 0 44px; }
.tracker-heading { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px; margin-bottom: 36px; }
.tracker-heading h1 { margin: 0; font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.045em; overflow-wrap: anywhere; }
.tracker-heading > div > p:last-child { margin: 13px 0 0; color: var(--muted); font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.stats { display: flex; border: 1px solid var(--line); border-radius: 8px; background: #0d1110; }
.stats article { min-width: 155px; padding: 18px 22px; }
.stats article + article { border-left: 1px solid var(--line); }
.stats span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.stats strong { font-size: 13px; font-weight: 500; }
.stats b { color: var(--green-bright); font-size: 25px; }
.heatmap-card { padding: 24px; overflow: hidden; background: linear-gradient(180deg, #111614, #0d1110); border: 1px solid #303834; border-radius: 9px; }
.card-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.card-heading h2 { margin: 0; font-size: 16px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .day-cell { width: 12px; height: 12px; background: var(--empty); border: 1px solid #303936; border-radius: 2px; }
.legend i.complete, .day-cell.complete { background: var(--green); border-color: #54e58c; }
.legend i.today, .day-cell.today { outline: 1px solid #eef7f1; outline-offset: 2px; }
.heatmap-scroll { overflow-x: auto; padding: 4px 4px 12px; scrollbar-color: #39443f #111513; }
.months { width: 870px; margin-left: 30px; display: grid; grid-template-columns: repeat(53, 12px); gap: 4px; min-height: 20px; color: #727e78; font-size: 9px; }
.months span { width: 28px; white-space: nowrap; }
.heatmap-layout { width: 900px; display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
.weekdays { display: grid; grid-template-rows: repeat(7, 12px); gap: 4px; color: #65706b; font-size: 9px; line-height: 12px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 4px; }
.day-cell.spacer { visibility: hidden; }
.today-card { display: grid; grid-template-columns: 1fr minmax(200px, 270px); gap: 24px; align-items: center; margin-top: 18px; padding: 20px 22px; background: #101412; border: 1px solid #2b332f; border-radius: 8px; }
.today-copy { display: flex; align-items: center; gap: 14px; }
.status-dot { width: 10px; height: 10px; background: #68736e; border-radius: 50%; box-shadow: 0 0 0 5px rgba(104, 115, 110, .1); }
.today-copy p { margin: 0 0 5px; color: var(--muted); font-size: 10px; }
.today-copy strong { font-size: 15px; }
#today-status.complete { color: var(--green-bright); }
.today-card:has(#today-status.complete) .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(54, 212, 117, .12); }
.today-card button { margin: 0; }
.today-card button.secondary { color: #dbe3df; background: transparent; border-color: #4a5650; }
.history-note { margin: 16px 2px 0; color: #68736e; font-size: 10px; line-height: 1.6; }
.history-note span { color: var(--green); }
footer { min-height: 64px; margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: #505a55; border-top: 1px solid #1b211e; font-size: 9px; letter-spacing: .12em; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 28px, 1180px); }
  .topbar { min-height: 64px; }
  .setup-view { min-height: auto; grid-template-columns: 1fr; gap: 44px; padding: 64px 0 54px; }
  .setup-copy h1 { font-size: 42px; }
  .setup-copy > p:last-child { font-size: 15px; }
  .setup-card { padding: 22px; }
  .tracker-view { padding-top: 42px; }
  .tracker-heading { grid-template-columns: 1fr; gap: 28px; }
  .stats { width: 100%; }
  .stats article { min-width: 0; flex: 1; padding: 16px; }
  .heatmap-card { padding: 18px 14px; }
  .card-heading { display: block; }
  .legend { margin-top: 17px; flex-wrap: wrap; }
  .heatmap-scroll { margin-right: -8px; }
  .today-card { grid-template-columns: 1fr; padding: 18px; }
  .today-card button { min-height: 50px; }
  footer { min-height: 58px; }
  footer span:first-child { max-width: 220px; line-height: 1.5; }
}

@media (prefers-reduced-motion: no-preference) {
  .day-cell.complete { animation: appear .24s ease-out both; }
  @keyframes appear { from { opacity: .35; transform: scale(.75); } }
}
