/* Uncoil — growth module styles. Uses the tokens from css/styles.css.
   .home- launch screen · .onb- onboarding · .ach- achievements · .ev- evidence */

/* ---------------- Home ---------------- */
.home-head { align-items: flex-start; }
.home-eyebrow { color: var(--accent-text); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.home-head h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.home-head-side { display: flex; align-items: center; gap: 14px; }
.home-streak { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); }
.home-streak .num { font-size: 2rem; line-height: 1; color: var(--accent-text); }
.home-streak .small { line-height: 1.05; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-main, .home-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Today card: the one thing to do */
.home-today {
  position: relative; padding: 24px 26px; border-radius: var(--radius);
  background: var(--raised); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); overflow: hidden;
}
.home-today::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.home-today.is-rest::before { background: var(--ok); }
.home-today-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.home-today-tag { background: var(--accent-soft); color: var(--accent-text); height: 26px; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; }
.home-today h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); margin-bottom: 10px; }
.home-why { color: var(--ink-2); font-size: 0.98rem; max-width: 54ch; }
.home-today-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.home-today-alt { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--ink-2); text-decoration: none; }
.home-today-alt:hover { color: var(--ink); }
.home-today-alt svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Round day */
.home-round { padding: 6px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); }
.home-round.is-on { border-color: var(--accent); }
.home-switch { border: 0; padding: 12px 14px; }
.home-switch:hover { border-color: transparent; background: var(--inset); border-radius: 10px; }
.home-switch[aria-pressed="true"] i { background: var(--ok); }
.home-steps { list-style: none; margin: 0; padding: 4px 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.home-step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.home-step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: var(--accent-ink); }
.home-step-dot svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.home-step.is-done .home-step-dot { background: var(--ok); border-color: var(--ok); color: #0b2016; }
.home-step.is-now .home-step-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.home-step-txt b { display: block; font-size: 0.95rem; }
.home-step-txt .small { display: block; line-height: 1.3; }
.home-step.is-done .home-step-txt b { color: var(--ink-2); }
.home-done-tag { background: var(--ok-soft); color: var(--ok); }

/* Streak calendar */
.home-cal { padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); }
.home-cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.home-cal-dows, .home-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 340px; }
.home-cal-dows { margin-bottom: 6px; font-size: 0.7rem; color: var(--ink-3); text-align: center; font-weight: 700; }
.home-cell { aspect-ratio: 1; border-radius: 6px; background: var(--inset); border: 1px solid transparent; }
.home-cell.is-routine { background: var(--ok); }
.home-cell.is-round { background: var(--accent-soft); border-width: 2px; border-color: var(--accent-text); }
.home-cell.is-both { background: var(--accent); }
.home-cell.is-future { opacity: 0.35; }
.home-cell.is-today { outline: 2px solid var(--line-strong); outline-offset: 2px; }
.home-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; color: var(--ink-2); }
.home-legend span { display: inline-flex; align-items: center; gap: 6px; }
.home-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--inset); border: 1px solid transparent; }
.home-legend i.is-routine { background: var(--ok); }
.home-legend i.is-round { background: var(--accent-soft); border-color: var(--accent-text); }
.home-legend i.is-both { background: var(--accent); }
.home-sample { margin-top: 10px; color: var(--ink-3); }

/* Side cards */
.home-card { padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); display: flex; flex-direction: column; gap: 10px; }
.home-card.is-empty { border-style: dashed; background: transparent; }
.home-card .btn { align-self: flex-start; }
.home-mob-head, .home-last-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.home-mob-num { font-size: 2.6rem; line-height: 1; }
.home-mob-num.is-ok { color: var(--ok); }
.home-mob-num.is-warn { color: var(--warn); }
.home-mob-num.is-stop { color: var(--stop); }
.home-bar { height: 10px; border-radius: 5px; background: var(--inset); overflow: hidden; }
.home-bar i { display: block; height: 100%; border-radius: 5px; background: var(--ok); }
.home-bar i.is-warn { background: var(--warn); }
.home-bar i.is-stop { background: var(--stop); }
.home-mob-scale { display: flex; justify-content: space-between; margin-top: -4px; }
.home-due { color: var(--warn); }
.home-mob-actions, .home-last-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.home-pain { font-size: 2.6rem; line-height: 1; }
.home-pain small { font-family: var(--body); font-weight: 400; font-size: 0.8rem; color: var(--ink-2); }
.home-pain.is-hi { color: var(--stop); }
.home-pain.is-mid { color: var(--warn); }
.home-pain.is-lo { color: var(--ok); }
.home-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.home-note { color: var(--ink-2); font-style: italic; }

.home-quick { grid-template-columns: repeat(4, 1fr); margin-top: 26px; }
.home-cardpreview { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.home-cardpreview canvas { display: block; margin-top: 12px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------- Achievements ---------------- */
.ach-strip { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--raised); }
.ach-strip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ach-strip-head a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 700; }
.ach-strip-head a svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ach-strip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px; }
.ach-chip { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--inset); color: var(--ink-3); border: 1px solid transparent; }
.ach-chip.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.ach-chip svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.ach-section { margin-top: 36px; }
.ach-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.ach-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ach-badge { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: transparent; display: flex; flex-direction: column; gap: 4px; opacity: 0.55; }
.ach-badge.is-on { opacity: 1; background: var(--raised); border-color: var(--line-strong); }
.ach-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--inset); color: var(--ink-3); margin-bottom: 4px; }
.ach-badge.is-on .ach-mark { background: var(--accent); color: var(--accent-ink); }
.ach-mark svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ach-badge b { font-family: var(--display); font-variation-settings: 'wdth' 106; font-size: 1.02rem; }
.ach-badge .small { color: var(--ink-2); line-height: 1.35; }
.ach-when { color: var(--ink-3); margin-top: 4px; font-size: 0.78rem; }
.ach-badge.is-on .ach-when { color: var(--accent-text); }

/* ---------------- Onboarding ---------------- */
.onb-card { width: min(540px, 100%); }
.onb-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 14px 14px 10px 20px; background: var(--raised); border-bottom: 1px solid var(--line); }
.onb-brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; color: var(--ink); }
.onb-mark { width: 22px; height: 22px; color: var(--accent-text); }
.onb-dots { flex: 1; display: flex; justify-content: center; gap: 6px; }
.onb-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--inset); }
.onb-dots i.is-done { background: var(--line-strong); }
.onb-dots i.is-on { background: var(--accent); }
.onb-body { padding: 24px 26px 6px; }
.onb-eyebrow { color: var(--accent-text); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.onb-body h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); margin-bottom: 8px; }
.onb-body > p.muted { font-size: 0.92rem; }
.onb-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.onb-opt { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.onb-opt:hover { border-color: var(--line-strong); background: var(--inset); }
.onb-opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
.onb-opt b { display: block; font-size: 1rem; }
.onb-opt .small { display: block; color: var(--ink-2); line-height: 1.3; margin-top: 2px; }
.onb-opt-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.onb-opt-tick svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.onb-opt.is-on .onb-opt-tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.onb-chips { margin-top: 18px; }
.onb-note { margin-top: 14px; }
.onb-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.onb-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 0.93rem; color: var(--ink-2); }
.onb-list svg { width: 18px; height: 18px; margin-top: 2px; stroke: var(--ok); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.onb-foot { display: flex; justify-content: space-between; gap: 10px; padding: 20px 26px 26px; }
.onb-foot .btn-primary { margin-left: auto; }

/* ---------------- Evidence ---------------- */
.ev-list { display: flex; flex-direction: column; }
.ev-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.ev-item:last-child { border-bottom: 1px solid var(--line); }
.ev-n { font-size: 1.8rem; line-height: 1; color: var(--accent-text); opacity: 0.75; }
.ev-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ev-body h3 { font-size: 1.28rem; max-width: 40ch; }
.ev-body > p { font-size: 0.97rem; color: var(--ink-2); max-width: 68ch; }
.ev-take { padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--ink) !important; font-size: 0.94rem !important; }
.ev-take b { color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.76rem; margin-right: 6px; }
.ev-pop { margin: 0; }
.ev-cite { color: var(--ink-2) !important; font-size: 0.85rem !important; line-height: 1.55; max-width: 78ch; }
.ev-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-links .linkchip { text-decoration: none; }
.ev-note { color: var(--warn) !important; font-size: 0.84rem !important; }

.ev-dropped, .ev-about { margin-top: 40px; }
.ev-drops { margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ev-drops div { padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-strong); }
.ev-drops dt { font-weight: 700; margin-bottom: 6px; }
.ev-drops dd { margin: 0; color: var(--ink-2); }
.ev-about-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px 28px; margin-top: 16px; }
.ev-about-grid h4 { margin-bottom: 6px; color: var(--accent-text); }
.ev-about-grid p { color: var(--ink-2); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-quick { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .home-quick { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home-head { flex-direction: column; align-items: stretch; }
  .home-head-side { justify-content: space-between; }
  .home-today { padding: 20px; }
  .home-today-actions .btn { flex: 1 1 auto; }
  .home-cal-dows, .home-cal-grid { max-width: none; }
  .home-step { grid-template-columns: 24px minmax(0, 1fr); row-gap: 8px; }
  .home-step > :last-child { grid-column: 2; justify-self: start; }
  .ach-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ev-item { grid-template-columns: 1fr; gap: 10px; }
  .ev-n { font-size: 1.1rem; }
  .onb-body { padding: 20px 18px 6px; }
  .onb-foot { padding: 16px 18px calc(20px + env(safe-area-inset-bottom)); }
  .onb-opt { padding: 15px; }
  .onb-card { max-height: 100%; }
}
