/* Tokens copied by value from frontend/src/index.css (Tailwind indigo / purple /
   slate / emerald). Light by default, dark via prefers-color-scheme. */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ground-a: #eef2ff;   /* indigo-50 */
  --ground-b: #faf5ff;   /* purple-50 */
  --surface: #ffffff;
  --border: #e2e8f0;     /* slate-200 */
  --text: #0f172a;       /* slate-900 */
  --text-2: #1e293b;     /* slate-800 */
  --text-3: #475569;     /* slate-600 */
  --text-4: #64748b;     /* slate-500 */
  --text-5: #94a3b8;     /* slate-400 */
  --accent: #4f46e5;     /* indigo-600 */
  --accent-hover: #4338ca; /* indigo-700 */
  --accent-alt: #9333ea; /* purple-600 */
  --good: #059669;       /* emerald-600 */
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground-a: #0f172a;  /* slate-900 */
    --ground-b: #1e1b4b;  /* indigo-950 */
    --surface: #1e293b;   /* slate-800 */
    --border: #334155;    /* slate-700 */
    --text: #f1f5f9;      /* slate-100 */
    --text-2: #e2e8f0;    /* slate-200 */
    --text-3: #cbd5e1;    /* slate-300 */
    --text-4: #94a3b8;    /* slate-400 */
    --text-5: #64748b;    /* slate-500 */
    --accent: #6366f1;    /* indigo-500 */
    --accent-hover: #818cf8; /* indigo-400 */
    --accent-alt: #a855f7; /* purple-500 */
    --good: #34d399;      /* emerald-400 */
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--ground-a), var(--ground-b));
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  -webkit-font-smoothing: antialiased;
}
main { width: 100%; max-width: 28rem; }
header { text-align: center; margin-bottom: 1.5rem; }
.wordmark {
  font-size: 1.125rem; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h1 {
  font-size: 1.5rem; line-height: 1.2; font-weight: 600;
  margin: .75rem 0 0; color: var(--text);
  text-wrap: balance;
}
@media (min-width: 640px) { h1 { font-size: 1.875rem; } }
.support { font-size: .875rem; line-height: 1.5; color: var(--text-3); margin: .5rem 0 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 1rem; box-shadow: var(--shadow); padding: 1.5rem;
}
.table { margin: 0; display: grid; gap: .75rem; }
.table > div { display: flex; align-items: baseline; gap: .75rem; }
dt {
  flex: 0 0 3rem; text-align: right;
  font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text);
}
dt.good { color: var(--good); }
dd { margin: 0; min-width: 0; font-size: .875rem; color: var(--text-2); }
dd small { display: block; font-size: .75rem; color: var(--text-4); }
.total {
  margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--text-4); font-variant-numeric: tabular-nums;
}
.caption { margin: .75rem 0 0; font-size: .75rem; line-height: 1.5; color: var(--text-4); }

.cta {
  display: block; margin-top: 1.25rem; width: 100%; text-align: center;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: .75rem; padding: .75rem 1rem; font-weight: 600; font-size: 1rem;
  transition: background .15s;
}
.cta:hover { background: var(--accent-hover); }
.price { text-align: center; font-size: .75rem; color: var(--text-4); margin: .5rem 0 0; }
.signin { text-align: center; font-size: .75rem; color: var(--text-4); margin: 1rem 0 0; }
.signin a { color: var(--accent); text-decoration: none; }
.signin a:hover { color: var(--accent-hover); }
.footer { text-align: center; font-size: .6875rem; color: var(--text-5); margin: 1.5rem 0 0; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--accent); }

/* ---- finished-habit page ---- */
main.wide { max-width: 32rem; }
.wordmark a { color: inherit; text-decoration: none; }
.card + .card { margin-top: 1rem; }
.habit-name { font-size: 1.125rem; font-weight: 600; color: var(--text); }
.habit-meta { font-size: .75rem; color: var(--text-4); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.label { font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-4); margin-bottom: .5rem; }
.cal { margin-top: 1rem; display: grid; gap: 3px; justify-content: start; }
.wk { display: grid; grid-template-columns: 2.25rem repeat(7, minmax(0, 1.5rem)); gap: 3px; align-items: center; }
.wk b { font-size: .6875rem; font-weight: 500; color: var(--text-5); }
.cal i, .legend i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--cell-none); }
.legend i { display: inline-block; width: .8rem; vertical-align: -2px; margin: 0 .3rem 0 .6rem; }
.legend { font-size: .6875rem; color: var(--text-4); margin-top: .5rem; }
.cal i.out { background: transparent; }
.cal i.miss, .legend i.miss { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
.cal i.did-1, .legend i.did-1 { background: #6366f1; } /* accent-500 — the app's good-scale-1 */
.cal i.did-2 { background: #4f46e5; }  /* accent-600 */
.cal i.did-3 { background: #4338ca; }  /* accent-700 */
.cal i.did-4 { background: #3730a3; }  /* accent-800 */
.cal i.did-5 { background: #fbbf24; }  /* warn-400 — 5+ goes gold, as in the app */
:root { --cell-none: #f1f5f9; }        /* slate-100 */
@media (prefers-color-scheme: dark) { :root { --cell-none: #334155; } }
.phases { margin-top: .75rem; font-size: .75rem; color: var(--text-4); font-variant-numeric: tabular-nums; }
.prose { background: var(--cell-none); border-radius: .5rem; padding: .75rem; }
.prose p { margin: 0 0 .75rem; font-size: 13px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.prose p:last-child { margin-bottom: 0; }
blockquote { margin: 0; padding: .1rem 0 .1rem .9rem; border-left: 3px solid var(--accent); font-size: .9375rem; line-height: 1.55; color: var(--text-2); }
.attrib { margin-top: .5rem; font-size: .75rem; color: var(--text-4); }
