/* 26-coach.css — the smart coach panel on Insights (js/ui/coach.js, js/ui/coach-local.js). */

.coach[hidden],[data-coach-feat][hidden]{display:none}
.coach-intro{margin:0 0 12px;font-size:12.5px;line-height:1.8;color:var(--dim)}
.coach-ctl{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:10px}
.coach-ctl .seg{flex:0 1 320px;min-width:220px}
.coach-opt{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink);cursor:pointer;user-select:none}
.coach-opt input{width:16px;height:16px;accent-color:var(--acc);margin:0}
.coach-go{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;margin-bottom:12px}
.coach-go .btn .ic{width:15px;height:15px}
.coach-meta{font-size:12px;color:var(--mute)}
.coach-sub{font-size:11.5px;color:var(--mute);line-height:1.6}

/* The coach is looking deeper (the deeper review takes the card when it is in) */
.coach-deep{display:flex;align-items:center;gap:10px;padding:9px 16px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--acc) 7%,transparent);font-size:12px;font-weight:600;color:var(--dim)}
.coach-deep .coach-spin{width:15px;height:15px;border-width:2px}
.coach-spin{width:20px;height:20px;flex:0 0 auto;border-radius:50%;border:2.5px solid var(--line2);border-top-color:var(--acc);animation:coach-spin .9s linear infinite}
@keyframes coach-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.coach-spin{animation-duration:2.4s}}

/* The review */
.coach-card{border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surf);overflow:hidden}
.coach-head{display:flex;align-items:center;gap:14px;padding:14px 16px;background:linear-gradient(135deg,var(--acc-dim),transparent 70%);border-bottom:1px solid var(--line)}
.coach-hl-w{flex:1 1 auto;min-width:0}
.coach-hl{font-size:15px;font-weight:800;line-height:1.6;color:var(--ink);overflow-wrap:anywhere}
.coach-score{position:relative;width:64px;height:64px;flex:0 0 auto}
.coach-score svg{width:64px;height:64px;transform:rotate(-90deg)}
.coach-score circle{fill:none;stroke-width:6}
.coach-score .trk{stroke:var(--line)}
.coach-score .val{stroke:var(--acc);stroke-linecap:round}
.coach-score.up .val{stroke:var(--up)}.coach-score.mid .val{stroke:var(--warn)}.coach-score.dn .val{stroke:var(--dn)}
.coach-score-n{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;font-variant-numeric:tabular-nums}
.coach-score-n b{font-size:19px;font-weight:800;color:var(--ink)}
.coach-score-n small{margin-top:2px;padding-top:2px;border-top:1px solid var(--line2);font-size:9px;color:var(--mute)}
.coach-sec{padding:12px 16px;border-bottom:1px solid var(--line)}
.coach-sec h4{display:flex;align-items:center;gap:7px;margin:0 0 8px;font-size:12.5px;font-weight:800;color:var(--ink)}
.coach-sec h4 .ic{width:15px;height:15px}
.coach-sec.good h4 .ic{color:var(--up)}
.coach-sec.bad h4 .ic{color:var(--dn)}
.coach-sec.rules h4 .ic{color:var(--acc)}
.coach-sec ul,.coach-sec ol{margin:0;padding-inline-start:1.2em;display:flex;flex-direction:column;gap:8px}
.coach-sec li{font-size:12.5px;line-height:1.8;color:var(--dim);overflow-wrap:anywhere}
.coach-sec li b{display:block;font-size:13px;color:var(--ink)}
.coach-sec li>span{display:block}
.coach-sec.rules li{color:var(--ink);font-weight:600}
.coach-sec.notes h4 .ic{color:var(--acc)}
.coach-sec>p{margin:0;font-size:12.5px;line-height:1.9;color:var(--dim);overflow-wrap:anywhere}
/* The coach's take: the story behind the numbers */
.coach-take{margin:12px 16px 0;padding:11px 13px;border-radius:var(--r-md);border:1px solid color-mix(in srgb,var(--acc) 30%,var(--line));background:color-mix(in srgb,var(--acc) 6%,var(--surf))}
.coach-take h4{display:flex;align-items:center;gap:7px;margin:0 0 6px;font-size:12px;font-weight:800;color:var(--acc)}
.coach-take h4 .ic{width:15px;height:15px}
.coach-take p{margin:0;font-size:13px;line-height:1.95;color:var(--ink);overflow-wrap:anywhere}
.coach-ev{display:inline-flex;align-items:center;gap:5px;margin-top:4px;padding:2px 8px;border-radius:var(--r-pill);font-style:normal;font-size:11.5px;color:var(--dn);background:var(--dn-dim)}
.coach-ev .ic{width:12px;height:12px;flex:0 0 auto}
.coach-focus{display:flex;gap:10px;align-items:flex-start;margin:12px 16px;padding:10px 12px;border-radius:var(--r-md);background:var(--acc-dim)}
.coach-focus .ic{width:18px;height:18px;flex:0 0 auto;margin-top:2px;color:var(--acc)}
.coach-focus small{font-size:11px;font-weight:700;color:var(--acc)}
.coach-focus p{margin:0;font-size:13px;font-weight:600;line-height:1.8;color:var(--ink);overflow-wrap:anywhere}
/* Close: back into the list. */
.coach-hl-w{flex:1 1 auto;min-width:0}
.coach-x{flex:0 0 auto;align-self:flex-start;margin:-4px -6px 0 0}
[dir="rtl"] .coach-x{margin:-4px 0 0 -6px}
/* The rules came from a lesson the AI taught for these same leaks. */
/* Only the last three are kept: save one to the Notebook to keep it. */
.coach-keep{display:flex;align-items:flex-start;gap:8px;margin:0 16px;padding:9px 12px;border-radius:10px;background:var(--surf2);border:1px dashed var(--line2);font-size:12px;line-height:1.7;color:var(--dim)}
.coach-keep .ic{flex:0 0 auto;width:15px;height:15px;margin-top:3px;color:var(--acc)}
.coach-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 16px 12px}
.coach-note{flex:1 1 220px;font-size:11px;line-height:1.7;color:var(--mute)}
.coach-btns{display:inline-flex;gap:6px;flex:0 0 auto}
.coach-btns .btn .ic{width:13px;height:13px}

/* Earlier reviews */
.coach-hist{margin-top:14px;display:flex;flex-direction:column;gap:6px}
.coach-hist-h{font-size:11.5px;font-weight:700;color:var(--mute);margin-bottom:2px}
.coach-hrow{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surf2);color:inherit;font:inherit;text-align:start;cursor:pointer;transition:background var(--t1)}
.coach-hrow:hover{background:var(--hover)}
.coach-hrow .chev{width:16px;height:16px;flex:0 0 auto;color:var(--mute)}
[dir="rtl"] .coach-hrow .chev{transform:scaleX(-1)}
.coach-hmain{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.coach-htitle{font-size:12.5px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.coach-hdot{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:50%;font-size:11px;font-weight:800;direction:ltr;color:var(--ink);background:var(--surf3);border:2px solid var(--line2)}
.coach-hdot.up{border-color:var(--up)}.coach-hdot.mid{border-color:var(--warn)}.coach-hdot.dn{border-color:var(--dn)}

/* "What is sent?" */

/* Charts on a review (js/ui/coach-local.js coachVizHtml): meters, the
   period's equity line, P&L bars. Marks carry direction (up / warn / down);
   every value is text in ink, never color alone. */
.coach-viz{display:grid;gap:14px;padding:14px 16px 6px;border-bottom:1px solid var(--line)}
.cv-meters{display:flex;justify-content:space-around;gap:6px}
.cv-meter{position:relative;flex:1 1 0;max-width:110px;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.cv-meter svg{width:56px;height:56px;transform:rotate(-90deg)}
.cv-meter circle{fill:none;stroke-width:5}
.cv-meter .val{stroke-linecap:round}
.cv-meter.up .trk{stroke:color-mix(in srgb,var(--up) 18%,transparent)}.cv-meter.up .val{stroke:var(--up)}
.cv-meter.mid .trk{stroke:color-mix(in srgb,var(--warn) 18%,transparent)}.cv-meter.mid .val{stroke:var(--warn)}
.cv-meter.dn .trk{stroke:color-mix(in srgb,var(--dn) 18%,transparent)}.cv-meter.dn .val{stroke:var(--dn)}
.cv-meter b{position:absolute;top:0;left:50%;width:56px;height:56px;margin-left:-28px;display:grid;place-items:center;font-size:13.5px;font-weight:800;color:var(--ink)}
.cv-meter small{font-size:11px;line-height:1.4;color:var(--dim)}
.cv-eq-h{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:4px;font-size:12px;color:var(--dim)}
.cv-eq-h b{font-size:13px;color:var(--ink);font-variant-numeric:tabular-nums}
.cv-eq-plot{position:relative;height:72px;touch-action:pan-y}
.cv-eq-svg{display:block;width:100%;height:72px;overflow:visible}
.cv-eq-svg .base{stroke:var(--line);stroke-width:1;vector-effect:non-scaling-stroke}
.cv-eq-svg .ln{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
.cv-eq-svg .area{stroke:none;opacity:.1}
.cv-eq-svg .xh{stroke:var(--mute);stroke-width:1;vector-effect:non-scaling-stroke}
.cv-eq-svg.up .ln{stroke:var(--up)}.cv-eq-svg.up .area{fill:var(--up)}
.cv-eq-svg.dn .ln{stroke:var(--dn)}.cv-eq-svg.dn .area{fill:var(--dn)}
.cv-dot{position:absolute;width:8px;height:8px;margin:-4px 0 0 -4px;border-radius:50%;box-shadow:0 0 0 2px var(--surf);pointer-events:none}
.cv-dot.up{background:var(--up)}.cv-dot.dn{background:var(--dn)}
.cv-bars h5{margin:0 0 6px;font-size:12px;font-weight:600;color:var(--dim)}
.cv-row{display:grid;grid-template-columns:minmax(58px,28%) 1fr minmax(70px,auto);align-items:center;gap:8px;padding:3px 0;font-size:12px}
.cv-k{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}
.cv-trk{position:relative;height:10px}
.cv-trk::before{content:"";position:absolute;left:50%;top:-3px;bottom:-3px;width:1px;background:var(--line)}
.cv-bar{position:absolute;top:0;bottom:0;min-width:2px}
.cv-bar.up{background:var(--up);border-radius:0 4px 4px 0}
.cv-bar.dn{background:var(--dn);border-radius:4px 0 0 4px}
.cv-v{font-size:11.5px;color:var(--dim);font-variant-numeric:tabular-nums;text-align:end}
@media(min-width:760px){.coach-viz{grid-template-columns:1fr 1fr;column-gap:22px}.cv-meters{grid-column:1/-1}}
/* This period against the one before: now, the change (arrow + sign + color), what it was */
.cv-cmp h5{margin:0 0 4px;font-size:12px;font-weight:600;color:var(--dim)}
.cv-cmp-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(64px,auto);align-items:center;gap:10px;padding:5px 0;border-top:1px solid var(--line);font-size:12px}
.cv-cmp-row:first-of-type{border-top:0}
.cv-cmp-row .cv-k{display:flex;flex-direction:column;white-space:normal}
.cv-was{font-size:10.5px;color:var(--mute)}
.cv-now{font-size:13px;color:var(--ink);font-variant-numeric:tabular-nums}
.cv-delta{display:inline-flex;align-items:center;justify-content:center;gap:3px;padding:2px 7px;border-radius:999px;font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--dim);background:var(--surf3)}
.cv-delta .ic{width:11px;height:11px}
.cv-delta.up{color:var(--up);background:var(--up-dim)}
.cv-delta.dn{color:var(--dn);background:var(--dn-dim)}
