/* Coach + Review pages, and the ✨ Write reply sheet. Colours come from the theme tokens only. */

/* ---------- coach ---------- */
.co-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--gap); }
.co-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--edge-2); background: var(--glass); color: var(--muted); cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s, color .2s, transform .1s; }
.co-tab:hover { border-color: var(--a1); color: var(--text); }
.co-tab:active { transform: scale(.97); }
.co-tab.on { color: var(--text); border-color: var(--a1); background: color-mix(in srgb, var(--a1) 14%, transparent); box-shadow: var(--glow); }
.co-tab > span { max-width: 100%; }
.co-tab-icon { font-size: 22px; line-height: 1; }
.co-tab-score { font: 600 calc(11px * var(--text-k)) var(--mono); color: var(--a1); }
.co-hero-top { display: flex; gap: 16px; align-items: center; }
.co-headline { font-size: calc(20px * var(--text-k)); margin: 6px 0 4px; line-height: 1.25; overflow-wrap: anywhere; }
.co-focus { margin-top: 14px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--edge); background: color-mix(in srgb, var(--a2) 8%, transparent); overflow-wrap: anywhere; }
.co-scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.co-score { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 8px; border-radius: 12px; border: 1px solid var(--edge-2); background: none; color: var(--text); cursor: pointer; text-align: left; }
.co-score:hover { border-color: var(--a1); }
.co-score small { color: var(--muted); font-size: calc(11px * var(--text-k)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-score .meter { width: 100%; margin-top: 4px; }
.co-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.co-insight { display: flex; flex-direction: column; gap: 6px; animation: rise .4s ease both; animation-delay: calc(var(--i, 0) * 70ms); }
.co-insight h3 { font-size: calc(15.5px * var(--text-k)); margin: 0; overflow-wrap: anywhere; }
.co-evidence { padding: 7px 10px; border-radius: 10px; border-left: 2px solid var(--a1); background: color-mix(in srgb, var(--a1) 10%, transparent); overflow-wrap: anywhere; line-height: 1.4; }
.co-tip { overflow-wrap: anywhere; }
.co-busy { animation: blink 1.3s ease-in-out infinite; }
.co-chat .chat { max-height: 45dvh; }
.co-ask { margin: 12px 0 10px; }
.co-ask input { flex: 1; min-width: 0; }
.co-home-body { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.co-home-title { font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
@media (max-width: 860px) { .co-insights { grid-template-columns: minmax(0, 1fr); } .co-scores { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .co-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .co-hero-top { flex-direction: column; align-items: flex-start; } .co-home-body > div:last-child { display: none; } }

/* ---------- weekly review ---------- */
.rv-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-pick b { white-space: nowrap; }
.rv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.rv-kpi { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rv-kpi b { display: block; font-size: calc(clamp(24px, 3vw, 34px) * var(--text-k)); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 0 calc(16px * var(--glow-k)) color-mix(in srgb, var(--a1) 45%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-skel b { color: transparent; border-radius: 8px; background: linear-gradient(90deg, var(--glass), var(--glass-2), var(--glass)) 0 0 / 200% 100%; animation: rv-shimmer 1.2s linear infinite; }
@keyframes rv-shimmer { to { background-position: -200% 0; } }
.rv-delta { font: 600 calc(12px * var(--text-k)) var(--mono); padding: 3px 8px; border-radius: 99px; white-space: nowrap; flex: none; background: var(--glass-2); color: var(--muted); }
.rv-delta.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.rv-delta.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.rv-panel { min-width: 0; }
.rv-days { margin-top: 12px; }
.rv-spark { width: 160px; max-width: 50%; }
.rv-best b { display: block; font-size: calc(30px * var(--text-k)); margin: 8px 0 2px; }
.rv-streak { color: var(--text); cursor: default; }
.rv-wins, .rv-goals, .rv-prios { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-wins li { display: flex; gap: 10px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; animation: rise .35s ease both; animation-delay: calc(var(--i, 0) * 45ms); }
.rv-tick { color: var(--good); font-weight: 700; flex: none; }
.rv-goals li .meter { margin-top: 6px; }
.rv-plan { margin-top: 0; }
.rv-recap { margin: 10px 0 14px; font-size: calc(15.5px * var(--text-k)); line-height: 1.5; overflow-wrap: anywhere; }
.rv-prios { margin: 8px 0 14px; }
.rv-prios li { display: flex; gap: 10px; align-items: flex-start; }
.rv-prios li > input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin-top: 10px; flex: none; }
.rv-prio-text { min-height: 0; resize: none; margin-bottom: 4px; line-height: 1.35; }
.rv-prios li.added .rv-prio-text { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.rv-body { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.rv-body .stat { min-width: 0; }
.rv-body .stat b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.rv-home-stats .stat { min-width: 0; }
/* bars grow up from the floor the first time a week is shown */
.rv-anim .rv-days .chart-bars > div > div:nth-child(2) { transform-origin: bottom; animation: rv-grow .8s cubic-bezier(.2, .8, .2, 1) both; }
.rv-anim .rv-days .chart-bars > div:nth-child(2) > div:nth-child(2) { animation-delay: .05s; }
.rv-anim .rv-days .chart-bars > div:nth-child(3) > div:nth-child(2) { animation-delay: .1s; }
.rv-anim .rv-days .chart-bars > div:nth-child(4) > div:nth-child(2) { animation-delay: .15s; }
.rv-anim .rv-days .chart-bars > div:nth-child(5) > div:nth-child(2) { animation-delay: .2s; }
.rv-anim .rv-days .chart-bars > div:nth-child(6) > div:nth-child(2) { animation-delay: .25s; }
.rv-anim .rv-days .chart-bars > div:nth-child(7) > div:nth-child(2) { animation-delay: .3s; }
@keyframes rv-grow { from { transform: scaleY(0); opacity: .3; } to { transform: none; opacity: 1; } }
@media (max-width: 860px) { .rv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .rv-kpi { padding: 12px; } .rv-body { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- ✨ Write reply sheet ---------- */
.er-sheet { display: flex; flex-direction: column; gap: 10px; }
.er-to { margin-top: 6px; min-width: 0; }
.er-to > div { max-width: 100%; }
.er-notes input { flex: 1; min-width: 0; }
.er-text { min-height: 180px; line-height: 1.5; transition: opacity .2s; }
.er-loading { opacity: .5; }
.er-confirm { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--a1); background: color-mix(in srgb, var(--a1) 10%, transparent); box-shadow: var(--glow); overflow-wrap: anywhere; }
.er-style summary { cursor: pointer; color: var(--muted); padding: 6px 0; }

:root[data-motion="calm"] .co-insight, :root[data-motion="calm"] .co-busy, :root[data-motion="calm"] .rv-wins li, :root[data-motion="calm"] .rv-skel b,
:root[data-motion="calm"] .rv-anim .rv-days .chart-bars > div > div:nth-child(2) { animation: none !important; }
