/* The RaceAlpha guide: a green launcher pill docked bottom-right and a panel. Built from the desk's tokens (v2.css):
   a slate panel with the one float shadow, a navy well for the conversation, green for the launcher and the Ask
   button. Sits above the phone tab bar, and above the pay bar when that is showing (--ra-lift from assistant.js). */
.ra-guide{position:fixed;right:20px;bottom:calc(20px + var(--tabbar-h,0px) + var(--ra-lift,0px));z-index:41;display:flex;flex-direction:column;align-items:flex-end;gap:10px;font:14px/1.5 var(--font);color:var(--ink)}
.ra-guide[hidden]{display:none}

/* The launcher: a green pill (green is the desk's "act" colour) with the horse in a navy disc and a label that says
   what it will talk about. Under 640px the label shortens to "Ask" so it covers less of the card. */
.ra-horse{position:relative;display:inline-flex;align-items:center;gap:10px;height:52px;max-width:min(320px,calc(100vw - 40px));padding:5px 18px 5px 5px;border:0;border-radius:999px;background:var(--act);color:var(--act-ink);box-shadow:var(--shadow);cursor:pointer;font:700 14px/1.2 var(--font);letter-spacing:-.005em;transition:background .12s,transform .12s}
.ra-horse:hover{background:var(--act-hover)}
.ra-horse:active{transform:translateY(1px)}
.ra-horse:focus-visible{outline:2px solid var(--act);outline-offset:3px}
.ra-horse[aria-expanded="true"]{background:var(--panel-2);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line-2),var(--shadow)}
.ra-horse .ra-av{width:42px;height:42px;border-radius:50%;background:var(--bg);display:grid;place-items:center;flex:0 0 auto}
.ra-horse .ra-av img{width:30px;height:auto;display:block;animation:ra-bob 3.2s ease-in-out infinite}
.ra-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
/* only the horse moves; the pill stays put */
.ra-horse.perk .ra-av img{animation:ra-perk .6s cubic-bezier(.25,1,.5,1)}
.ra-horse.busy .ra-av img{animation:ra-trot .7s ease-in-out infinite}

.ra-panel{width:min(392px,calc(100vw - 32px));height:min(600px,calc(100dvh - var(--tabbar-h,0px) - var(--ra-lift,0px) - 140px));min-height:320px;display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line-2);border-radius:var(--r-lg);box-shadow:var(--shadow);overflow:hidden}
.ra-panel[hidden]{display:none}
.ra-head{display:flex;align-items:center;gap:10px;padding:12px 12px 12px 14px;border-bottom:1px solid var(--line);background:var(--panel-2)}
.ra-head .ra-av{width:34px;height:34px;border-radius:50%;background:var(--bg-1);border:1px solid var(--line-2);display:grid;place-items:center;flex:0 0 auto}
.ra-head .ra-av img{width:24px;height:auto}
.ra-head .ra-t{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.ra-head b{font:700 15px/1.2 var(--display);letter-spacing:-.01em}
.ra-head small{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ra-close{margin-left:auto;width:30px;height:30px;border:1px solid transparent;background:transparent;font-size:20px;line-height:1;cursor:pointer;color:var(--muted);border-radius:var(--r);display:grid;place-items:center;flex:0 0 auto}
.ra-close:hover{color:var(--ink);background:var(--panel-3)}
.ra-close:focus-visible{outline:2px solid var(--act);outline-offset:1px}

.ra-msgs{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--bg-1);overscroll-behavior:contain}
.ra-m{max-width:88%;padding:9px 12px;border-radius:10px;font-size:13.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}
.ra-m.u{align-self:flex-end;background:var(--panel-3);color:var(--ink);border-bottom-right-radius:3px}
.ra-m.a{align-self:flex-start;background:var(--panel);border:1px solid var(--line);color:var(--ink-2);border-bottom-left-radius:3px}
.ra-m.a b{color:var(--ink);font-weight:700}
.ra-m.a a{color:var(--act);font-weight:600}
.ra-m.a.err{border-style:dashed;border-color:var(--line-2);color:var(--muted)}
.ra-m.a.wait{color:var(--muted);padding:11px 12px}
.ra-m.a.wait i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--muted);margin-right:4px;animation:ra-dot 1s infinite}
.ra-m.a.wait i:nth-child(2){animation-delay:.15s}
.ra-m.a.wait i:nth-child(3){animation-delay:.3s;margin-right:0}

.ra-sugg{display:flex;gap:6px;flex-wrap:wrap;padding:10px 12px 0;background:var(--panel)}
.ra-sugg:empty{display:none}
.ra-sugg button{border:1px solid var(--line-2);background:var(--panel-2);border-radius:999px;padding:5px 11px;font:inherit;font-size:12px;font-weight:600;color:var(--ink-2);cursor:pointer;text-align:left;line-height:1.35;transition:border-color .12s,color .12s}
.ra-sugg button:hover{border-color:var(--muted);color:var(--ink)}
.ra-sugg button:focus-visible{outline:2px solid var(--act);outline-offset:2px}

.ra-form{display:flex;gap:8px;align-items:flex-end;padding:10px 12px 8px;background:var(--panel)}
.ra-form textarea{flex:1;font:inherit;font-size:14px;line-height:1.4;resize:none;border:1px solid var(--line-2);border-radius:var(--r);padding:9px 11px;min-height:40px;max-height:120px;background:var(--panel-2);color:var(--ink)}
.ra-form textarea::placeholder{color:var(--faint)}
.ra-form textarea:focus{outline:none;border-color:var(--act)}
.ra-form button{border:0;background:var(--act);color:var(--act-ink);border-radius:var(--r);height:40px;padding:0 16px;font:inherit;font-weight:700;cursor:pointer;transition:background .12s,transform .12s}
.ra-form button:hover{background:var(--act-hover)}
.ra-form button:active{transform:translateY(1px)}
.ra-form button:focus-visible{outline:2px solid var(--act);outline-offset:2px}
.ra-form button:disabled{opacity:.6;cursor:default;transform:none}
.ra-foot{font-size:11px;color:var(--faint);padding:0 12px 10px;background:var(--panel);line-height:1.4}

@keyframes ra-bob{0%,100%{transform:translate(1px,0)}50%{transform:translate(1px,-2px)}}
@keyframes ra-perk{0%{transform:translate(1px,0) rotate(0)}40%{transform:translate(1px,-6px) rotate(-8deg)}100%{transform:translate(1px,0) rotate(0)}}
@keyframes ra-trot{0%,100%{transform:translate(1px,0)}25%{transform:translate(1px,-3px) rotate(-4deg)}75%{transform:translate(1px,-3px) rotate(4deg)}}
@keyframes ra-dot{0%,80%,100%{opacity:.3}40%{opacity:1}}
@media (max-width:640px){
  .ra-guide{right:12px;bottom:calc(12px + var(--tabbar-h,0px) + var(--ra-lift,0px))}
  .ra-panel{width:calc(100vw - 24px);height:calc(100dvh - var(--tabbar-h,0px) - var(--ra-lift,0px) - 110px)}
  .ra-horse{height:48px;padding-right:16px;gap:8px}
  .ra-horse .ra-av{width:38px;height:38px}.ra-horse .ra-av img{width:27px}
  .ra-l2{display:none}
}
@media (prefers-reduced-motion:reduce){.ra-horse .ra-av img,.ra-horse.perk .ra-av img,.ra-horse.busy .ra-av img,.ra-m.a.wait i{animation:none}.ra-horse{transition:none}}

/* The sheet behind a race-card ask (trifecta orders and ways to cover them, or a ranked list), drawn above the
   guide's words. Figures are tabular and right-aligned; the saddlecloth numbers sit in small chips. */
.ra-m.ra-cardm{flex:0 0 auto;max-width:100%;width:100%;padding:0;white-space:normal;overflow:hidden}
.ra-card-h{display:flex;flex-direction:column;gap:1px;padding:10px 12px 8px;border-bottom:1px solid var(--line);background:var(--panel-2)}
.ra-card-h b{color:var(--ink);font:700 13.5px/1.3 var(--display)}
.ra-card-h small{color:var(--muted);font-size:11.5px}
.ra-tri,.ra-dst,.ra-cov{list-style:none;margin:0;padding:4px 0}
.ra-tri li,.ra-dst li,.ra-cov li{display:flex;align-items:center;gap:10px;padding:6px 12px;font-variant-numeric:tabular-nums}
.ra-tri li+li,.ra-dst li+li,.ra-cov li+li{border-top:1px solid var(--line)}
.ra-ord{display:flex;gap:3px;flex:0 0 auto}
.ra-ord i{font-style:normal;min-width:22px;height:22px;padding:0 4px;border-radius:5px;background:var(--panel-3);color:var(--ink);display:grid;place-items:center;font-weight:700;font-size:12px}
.ra-nm{flex:1;min-width:0;font-size:12.5px;color:var(--ink-2);line-height:1.35;display:flex;flex-direction:column}
.ra-nm b{color:var(--ink);font-weight:600}
.ra-nm small,.ra-cov small{color:var(--muted);font-size:11px}
.ra-cov li>span:first-child{flex:1;min-width:0;display:flex;flex-direction:column;font-size:12.5px;line-height:1.35}
.ra-cov b{color:var(--ink)}
.ra-pp{margin-left:auto;flex:0 0 auto;text-align:right;display:flex;flex-direction:column;line-height:1.3}
.ra-pp b{color:var(--ink);font-size:13px}
.ra-pp small{color:var(--muted);font-size:11px;white-space:nowrap}
.ra-card-s{padding:8px 12px 2px;border-top:1px solid var(--line);color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.ra-card-f{padding:7px 12px 9px;border-top:1px solid var(--line);color:var(--faint);font-size:11px;line-height:1.4}
