/* Coach Bardia: the voice-first coach screen, and the Coach orb in the bottom menu.
   The orb only shows for people who may use the coach (the page gets the class "coach-on"). */

/* ---- the Coach orb in the bottom menu ---- */
.tabbar a.tab-coach,.topnav a.nav-coach,.drawer-row.nav-coach{display:none}
html.coach-on .topnav a.nav-coach{display:inline-flex}
html.coach-on .drawer-row.nav-coach{display:flex}
.corb{display:block;border-radius:50%;background:radial-gradient(circle at 35% 30%,#FFFFFF 0%,#BFD6FF 28%,#4F7DF3 62%,#1E3FAE 100%)}
@media (max-width:720px){
  html.coach-on .tabbar a.tab-coach{display:flex;flex-direction:column;align-items:center;justify-content:center;width:62px;min-width:62px;height:62px;padding:0;margin:-30px 4px 0;border-radius:50%;background:none;box-shadow:none;overflow:visible}
  .tabbar a.tab-coach .corb{width:54px;height:54px;box-shadow:0 0 0 5px rgba(20,33,61,.92),0 0 26px rgba(110,160,255,.95);transition:transform .4s var(--spring,ease),box-shadow .3s}
  .tabbar a.tab-coach span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);max-width:none;margin:0}
  .tabbar a.tab-coach[aria-current="page"]{background:none;box-shadow:none}
  .tabbar a.tab-coach[aria-current="page"] .corb{outline:3px solid #FFFFFF;outline-offset:-1px}
  .tabbar a.tab-coach:active .corb{transform:scale(.92)}
}

/* ---- the coach screen ---- */
#v-coach{padding-bottom:110px}
.coach{display:flex;flex-direction:column;min-height:calc(100dvh - 210px);max-width:560px;margin:0 auto;color:var(--ink)}
.coach .cb-load{padding:40px 0;text-align:center}
.cb-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-family:var(--f-display);font-size:15px}
.cb-head b{font-weight:700}
.cb-ai{font-size:12px;font-weight:500;color:var(--muted)}
.cb-ack{width:44px;height:44px;margin-left:-10px;border:0;border-radius:50%;background:none;color:var(--ink);display:flex;align-items:center;justify-content:center;cursor:pointer}
.cb-ic{display:inline-flex}
.cb-ic svg{width:20px;height:20px}
.cb-label{font-family:var(--f-display);font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--cobalt)}
.cb-said{margin-top:26px;display:flex;flex-direction:column;gap:10px}
.cb-ig{margin:0;font-family:var(--f-serif,var(--f-display));font-size:27px;line-height:1.28;letter-spacing:-.012em;white-space:pre-line;overflow-wrap:anywhere}
.cb-ig.long{font-size:19px;line-height:1.45}
.cb-think{margin:0;font-family:var(--f-serif,var(--f-display));font-size:27px;color:var(--muted);display:flex;align-items:baseline;gap:5px}
.cb-think i{width:6px;height:6px;border-radius:50%;background:var(--cobalt);animation:cdot 1.2s infinite ease-in-out}
.cb-think i:nth-child(2){animation-delay:.18s}.cb-think i:nth-child(3){animation-delay:.36s}
@keyframes cdot{0%,80%,100%{opacity:.25;transform:translateY(0)}40%{opacity:1;transform:translateY(-4px)}}
.cb-you{margin-top:22px;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:16px;display:flex;flex-direction:column;gap:8px}
.cb-you .cb-label{color:var(--muted)}
.cb-you p{margin:0;font-size:17px;line-height:1.4;color:var(--ink);white-space:pre-line;overflow-wrap:anywhere}
.cb-err{margin:16px 0 0;padding:10px 14px;border-radius:12px;background:var(--warn-soft);color:var(--warn);font-size:14.5px}
.coach .notice.crisis{margin-top:8px}

.cb-stage{flex:1 1 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:30px 0 22px}
.cb-wave{display:flex;align-items:center;gap:5px;height:44px;opacity:.28;transition:opacity .3s}
.cb-wave i{width:4px;height:10px;border-radius:2px;background:var(--cobalt)}
.coach.rec .cb-wave{opacity:1}
.coach.rec .cb-wave i{animation:cb-wave 1s infinite ease-in-out}
.cb-wave i:nth-child(2){animation-delay:-.9s}.cb-wave i:nth-child(3){animation-delay:-.2s}.cb-wave i:nth-child(4){animation-delay:-.6s}.cb-wave i:nth-child(5){animation-delay:-.4s}
.cb-wave i:nth-child(6){animation-delay:-.75s}.cb-wave i:nth-child(7){animation-delay:-.1s}.cb-wave i:nth-child(8){animation-delay:-.5s}.cb-wave i:nth-child(9){animation-delay:-.3s}
.cb-wave i:nth-child(10){animation-delay:-.85s}.cb-wave i:nth-child(11){animation-delay:-.15s}
@keyframes cb-wave{0%,100%{height:10px}50%{height:42px}}
.cb-mic{width:132px;height:132px;border:0;border-radius:50%;background:var(--cobalt);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;
  box-shadow:0 0 0 14px rgba(36,87,197,.14),0 0 0 32px rgba(36,87,197,.07);transition:transform .25s,box-shadow .3s,background-color .3s}
.cb-mic .cb-ic svg{width:46px;height:46px;stroke-width:1.500}
.cb-mic:active{transform:scale(.95)}
.cb-mic:disabled{opacity:.5;cursor:default}
.coach.rec .cb-mic{background:var(--navy);animation:cpulse 1.6s infinite ease-in-out}
@keyframes cpulse{0%,100%{box-shadow:0 0 0 14px rgba(36,87,197,.16),0 0 0 32px rgba(36,87,197,.08)}50%{box-shadow:0 0 0 20px rgba(36,87,197,.2),0 0 0 44px rgba(36,87,197,.06)}}
.cb-hint{margin-top:14px;font-family:var(--f-display);font-size:15px;font-weight:500;color:var(--muted);font-variant-numeric:tabular-nums}
.cb-cancel{border:0;background:none;color:var(--muted);font:inherit;font-size:14px;text-decoration:underline;min-height:44px;padding:0 14px;cursor:pointer}

.cb-typewrap{flex:1 1 auto;display:flex;align-items:flex-end;padding:26px 0 22px}
.cb-typewrap .cb-comp{flex:1 1 auto}
.cb-comp{display:flex;align-items:flex-end;gap:8px;padding:8px;border:1px solid var(--line);border-radius:26px;background:var(--surface);box-shadow:0 6px 20px rgba(14,27,51,.06)}
.cb-comp textarea{flex:1 1 auto;min-width:0;min-height:44px;max-height:140px;resize:none;padding:11px 6px;border:0;outline:0;background:none;color:var(--ink);font:inherit;font-size:16px;line-height:1.4}
.cb-mini,.cb-send{width:44px;height:44px;flex:none;border:0;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer}
.cb-mini{background:var(--soft);color:var(--navy)}
.cb-comp.rec .cb-mini{background:var(--navy);color:#fff}
.cb-send{background:var(--cobalt);color:#fff}
.cb-mini:disabled,.cb-send:disabled{opacity:.5}
.cb-recline{flex:1 1 auto;display:flex;align-items:center;gap:4px;min-height:44px;padding-left:6px;font-family:var(--f-display);font-size:15px;color:var(--muted);font-variant-numeric:tabular-nums}
.cb-recline .cb-cancel{margin-left:auto}
.coach.history .cb-comp{position:sticky;bottom:calc(92px + env(safe-area-inset-bottom,0px));margin-top:8px;z-index:2}
.cb-voice{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--muted);font-family:var(--f-display);font-size:12.5px;font-weight:600;cursor:pointer}
.cb-voice.on{color:var(--cobalt);border-color:var(--cobalt)}
.cb-voice .cb-ic svg{width:16px;height:16px}
.cb-head .cb-ai{margin-left:auto}
.cb-hear{align-self:flex-start;display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--ink);font-family:var(--f-display);font-size:13.5px;font-weight:600;cursor:pointer}
.cb-hear .cb-ic svg{width:17px;height:17px}
.cb-hear.on{background:var(--navy);border-color:var(--navy);color:#fff}
.cb-hear.sm{min-height:32px;margin-top:8px;padding:0 10px;font-size:12px;border-color:transparent;background:var(--soft)}
.cb-hear.sm.on{background:var(--navy)}
.cb-hear:disabled{opacity:.6}
.cb-think.sm{font-family:inherit;font-size:15.5px}
.cb-foot{display:flex;gap:10px}
.cb-tn{flex:1 1 0;min-height:50px;display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);font-family:var(--f-display);font-size:15px;font-weight:500;cursor:pointer}
.cb-tn .cb-ic svg{width:18px;height:18px}
.cb-note{display:block;margin-top:14px;text-align:center;font-size:12px;line-height:1.45;color:var(--muted)}

.cb-list{display:flex;flex-direction:column;gap:10px;padding:18px 0 8px}
.cb-day{align-self:center;font-family:var(--f-display);font-size:11px;font-weight:600;color:var(--muted);margin-top:8px}
.cb-msg{max-width:86%;padding:11px 14px;border-radius:18px;font-size:15.5px;line-height:1.45}
.cb-msg p{margin:0;white-space:pre-line;overflow-wrap:anywhere}
.cb-msg.co{align-self:flex-start;background:var(--surface);border:1px solid var(--line);border-bottom-left-radius:5px}
.cb-msg.me{align-self:flex-end;background:var(--cobalt);color:#fff;border-bottom-right-radius:5px}
@media (prefers-reduced-motion:reduce){.coach.rec .cb-wave i,.coach.rec .cb-mic,.cb-think i{animation:none}}

.dic .corb{width:24px;height:24px}
.cb-hear{white-space:nowrap}
.cb-msg{display:flex;flex-direction:column;align-items:flex-start}

/* ---- live mode ---- */
.cb-golive{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;margin-bottom:10px;padding:8px 16px 8px 10px;border:0;border-radius:18px;background:var(--navy);color:#fff;text-align:left;font-family:var(--f-display);cursor:pointer;box-shadow:0 10px 26px rgba(22,50,94,.28)}
.cb-golive .corb{width:44px;height:44px;flex:none;box-shadow:0 0 18px rgba(110,160,255,.85)}
.cb-golive span{display:flex;flex-direction:column;gap:1px}
.cb-golive b{font-size:16px;font-weight:700}
.cb-golive small{font-size:12.5px;color:#C9D6EE}
.cb-livetag{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:0 12px;border-radius:999px;background:var(--navy);color:#fff;font-family:var(--f-display);font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums}
.cb-livetag i{width:8px;height:8px;border-radius:50%;background:#FF6B5E;animation:cb-blink 1.4s infinite ease-in-out}
@keyframes cb-blink{0%,100%{opacity:1}50%{opacity:.3}}
.cb-live{width:150px;height:150px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:rgba(36,87,197,.08);box-shadow:0 0 0 18px rgba(36,87,197,.05);transition:box-shadow .4s,background-color .4s}
.cb-live .corb{width:112px;height:112px;box-shadow:0 12px 34px rgba(47,91,234,.45);transition:transform .4s}
.cb-live[data-s="connecting"] .corb{opacity:.55;animation:cb-breathe 1.6s infinite ease-in-out}
.cb-live[data-s="listening"]{animation:cb-ring 2.4s infinite ease-in-out}
.cb-live[data-s="speaking"] .corb{animation:cb-speak .9s infinite ease-in-out}
@keyframes cb-breathe{0%,100%{transform:scale(.94)}50%{transform:scale(1)}}
@keyframes cb-ring{0%,100%{box-shadow:0 0 0 14px rgba(36,87,197,.06)}50%{box-shadow:0 0 0 30px rgba(36,87,197,.03)}}
@keyframes cb-speak{0%,100%{transform:scale(1)}30%{transform:scale(1.07)}60%{transform:scale(.98)}}
.cb-tn.cb-end{background:var(--sos);border-color:var(--sos);color:#fff}
.cb-tn[aria-pressed="true"]{background:var(--navy);border-color:var(--navy);color:#fff}
@media (prefers-reduced-motion:reduce){.cb-live,.cb-live .corb,.cb-livetag i{animation:none!important}}

/* main coach screen: one button for a live conversation, typing in the conversation view */
.cb-hint b{display:block;font-size:17px;font-weight:700;color:var(--ink);text-align:center}
.cb-hint small{display:block;margin-top:3px;font-size:13.5px;font-weight:500;color:var(--muted);text-align:center}
.cb-comp textarea{padding-left:12px}

/* ---------- My plan (plan.js) ---------- */
.coach.plan{gap:14px;padding-bottom:20px}
.pl-spacer{width:34px}
.pl-sec{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:16px 16px 12px;display:flex;flex-direction:column;gap:8px}
.pl-top{display:flex;align-items:center;gap:8px}
.coach .pl-title{margin:0;font-family:var(--f-display);font-size:17px;font-weight:700;color:var(--navy)}
.pl-count{min-width:22px;height:22px;padding:0 7px;border-radius:11px;background:var(--soft);color:var(--navy);font-family:var(--f-display);font-size:12px;font-weight:600;display:inline-flex;align-items:center;justify-content:center}
.coach .pl-help{margin:0 0 2px;font-size:13.5px;line-height:1.45;color:var(--muted)}
.coach .pl-empty{margin:2px 0;font-size:14px;line-height:1.45;color:var(--muted)}
.pl-row{display:flex;align-items:flex-start;gap:10px;border-top:1px solid var(--line);padding-top:8px}
.pl-main{flex:1 1 auto;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;padding:4px 0;border:0;background:none;color:var(--ink);text-align:left;font:inherit;cursor:pointer}
.pl-text{font-size:15.5px;line-height:1.4;overflow-wrap:anywhere}
.pl-row.done .pl-text{color:var(--muted);text-decoration:line-through}
.pl-sub{font-size:13px;line-height:1.4;color:var(--muted);overflow-wrap:anywhere}
.pl-tag{font-family:var(--f-display);font-size:11.5px;font-weight:600;color:var(--cobalt)}
.pl-tick{flex:0 0 auto;width:28px;height:28px;margin-top:8px;border:1.500px solid var(--line);border-radius:50%;background:var(--surface);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.pl-tick[aria-pressed="true"]{background:var(--cobalt);border-color:var(--cobalt)}
.pl-tick .cb-ic svg{width:16px;height:16px}
.pl-add{align-self:flex-start;min-height:44px;display:inline-flex;align-items:center;gap:6px;padding:0 4px;border:0;background:none;color:var(--cobalt);font-family:var(--f-display);font-size:15px;font-weight:600;cursor:pointer}
.pl-add .cb-ic svg{width:18px;height:18px}
.pl-form{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--line);padding-top:10px}
.pl-in{width:100%;box-sizing:border-box;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-size:16px;line-height:1.4}
textarea.pl-in{resize:vertical}
.pl-in:focus{outline:2px solid var(--cobalt);outline-offset:1px}
.pl-line{display:flex;flex-wrap:wrap;gap:10px}
.pl-field{flex:1 1 130px;display:flex;flex-direction:column;gap:4px;font-family:var(--f-display);font-size:12.5px;font-weight:600;color:var(--muted)}
.pl-acts{display:flex;flex-wrap:wrap;gap:8px}
.pl-btn{min-height:44px;padding:0 18px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-family:var(--f-display);font-size:15px;font-weight:600;cursor:pointer}
.pl-btn.primary{background:var(--navy);border-color:var(--navy);color:#fff}
.pl-btn.danger{margin-left:auto;border-color:transparent;color:var(--sos)}
.pl-btn[disabled]{opacity:.6;cursor:default}
