/* Label helper (SB-651): the bottom-right rules helper on /label. Loaded after styles.css and uses its tokens.
 * helper.js removes itself when this file is missing, so an unstyled panel never lands in the page. */
.lh{position:fixed;right:20px;bottom:20px;z-index:35;font:14px/1.5 var(--sans);color:var(--ink);pointer-events:none}
/* Only the parts take clicks: while the button steps aside, the spot it left belongs to the page. */
.lh>*{pointer-events:auto}
.lh button{font:inherit;cursor:pointer}
.lh svg{display:block}

/* The button: a small ember face that blinks, hops when it offers help and looks at the panel when open. */
.lh-fab{position:relative;display:inline-flex;align-items:center;gap:8px;height:56px;padding:0 20px 0 8px;border:0;border-radius:999px;background:var(--ember);color:#fff;box-shadow:0 6px 18px rgba(209,78,43,.32),0 1px 3px rgba(42,44,69,.18);transition:transform .24s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease,opacity .2s ease}
.lh-fab:hover{transform:translateY(-2px) scale(1.05);box-shadow:0 10px 24px rgba(209,78,43,.36),0 2px 4px rgba(42,44,69,.2)}
.lh-fab:active{transform:scale(.93)}
.lh-fab-label{font-size:14.5px;font-weight:650;letter-spacing:-.1px;white-space:nowrap}
.lh-fab:focus-visible,.lh-panel button:focus-visible,.lh-nudge button:focus-visible{outline:3px solid rgba(209,78,43,.4);outline-offset:2px}
.lh-face{width:40px;height:40px;overflow:visible}
.lh-eyes ellipse{fill:#fff}
.lh-pupils circle{fill:var(--ink);transition:transform .3s ease}
.lh-cheek{fill:#ffb3a1;opacity:.8}
.lh-mouth{fill:none;stroke:#fff;stroke-width:2.2;stroke-linecap:round;transition:d .25s ease}
.lh-eyes,.lh-pupils{transform-box:fill-box;transform-origin:center;animation:lh-blink 5.2s infinite}
.lh-open .lh-fab .lh-pupils circle{transform:translate(-1.2px,-1.4px)}
.lh-nudging .lh-fab{animation:lh-hop 1.5s cubic-bezier(.3,.7,.4,1) 2}
.lh-nudging .lh-fab .lh-mouth{d:path("M18 28.5q6 7 12 0")}
.lh-away .lh-fab{opacity:0;transform:scale(.55);pointer-events:none}
.lh-away .lh-nudge{display:none}
@keyframes lh-blink{0%,93%,100%{transform:scaleY(1)}96%{transform:scaleY(.12)}}
@keyframes lh-hop{0%,100%{transform:none}12%{transform:translateY(-9px) rotate(-7deg)}24%{transform:translateY(0) rotate(5deg)}34%{transform:translateY(-3px) rotate(-2deg)}44%{transform:none}}

/* "Tricky one?": a speech bubble above the button. It never takes focus. */
.lh-nudge{position:absolute;right:2px;bottom:70px;width:max-content;max-width:250px;padding:10px 12px 11px;border-radius:14px 14px 4px 14px;background:var(--solid,#2A2C45);color:#fff;box-shadow:0 12px 30px rgba(42,44,69,.28);transform-origin:bottom right;animation:lh-pop .4s cubic-bezier(.34,1.56,.64,1) both}
.lh-nudge p{margin:0 0 8px;font-weight:600;font-size:13.5px}
.lh-nudge-acts{display:flex;gap:6px}
.lh-nudge-acts button{border:0;border-radius:999px;padding:5px 12px;font-size:12.5px;font-weight:600;transition:background .15s ease,transform .15s ease}
.lh-nudge-acts button:active{transform:scale(.95)}
.lh-nudge-yes{background:var(--ember);color:#fff}
.lh-nudge-yes:hover{background:var(--ember-deep)}
.lh-nudge-no{background:rgba(255,255,255,.14);color:#fff}
.lh-nudge-no:hover{background:rgba(255,255,255,.24)}

/* The panel */
.lh-panel{position:absolute;right:0;bottom:66px;width:344px;max-width:calc(100vw - 32px);max-height:min(520px,calc(100vh - 130px));display:flex;flex-direction:column;overflow:hidden;background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px rgba(42,44,69,.22),0 2px 8px rgba(42,44,69,.08);transform-origin:bottom right;animation:lh-pop .34s cubic-bezier(.34,1.56,.64,1) both;transition:transform .22s cubic-bezier(.34,1.56,.64,1)}
.lh-panel:focus{outline:none}
.lh-panel.lh-leaving{animation:lh-out .19s ease-in both}
.lh-panel.lh-dragging{animation:none;transition:none}
@keyframes lh-pop{from{opacity:0;transform:translateY(12px) scale(.9)}to{opacity:1;transform:none}}
@keyframes lh-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(10px) scale(.94)}}
.lh-head{position:relative;display:flex;align-items:center;gap:10px;padding:12px 10px 10px 14px;border-bottom:1px solid var(--line-soft);touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
.lh-grab{display:none;position:absolute;top:6px;left:50%;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:var(--line)}
.lh-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--ember)}
.lh-avatar .lh-face{width:28px;height:28px}
.lh-heading{flex:1;min-width:0}
.lh-heading h2{margin:0;font-size:14px;line-height:1.3;letter-spacing:-.1px}
.lh-heading p{margin:0;font-size:12px;color:var(--muted)}
.lh-x{display:grid;place-items:center;flex:none;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);transition:background .15s ease,color .15s ease}
.lh-x:hover{background:var(--panel-2);color:var(--ink)}
.lh-x svg,.lh-send svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Messages: short cards, mono for words, pills for tags */
.lh-log{flex:1;min-height:90px;overflow-y:auto;overscroll-behavior:contain;padding:12px;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin}
.lh-msg{max-width:94%;animation:lh-in .28s cubic-bezier(.2,.8,.3,1) both}
@keyframes lh-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.lh-me{align-self:flex-end;padding:7px 11px;border-radius:14px 14px 4px 14px;background:var(--wash);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
.lh-bot{align-self:flex-start;display:flex;flex-direction:column;gap:8px}
.lh-bot>.lh-text{padding:8px 11px;border-radius:14px 14px 14px 4px;background:var(--panel-2)}
.lh-card{display:flex;flex-direction:column;gap:5px;padding:10px 12px;border-radius:14px 14px 14px 4px;background:var(--panel-2)}
.lh-title{margin:0;font-weight:650;font-size:13.5px;line-height:1.35}
.lh-text{margin:0;font-size:13px;line-height:1.5}
.lh-example{margin:0;padding-left:8px;border-left:2px solid var(--line);font-size:12.5px;color:var(--muted)}
.lh-note{margin:0;font-size:12px;color:var(--muted)}
.lh-source{margin:2px 0 0;font-size:11px;color:var(--faint)}
.lh-answer{display:flex;flex-direction:column;gap:5px}.lh-answer strong{font-weight:650}
.lh-points{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:3px}.lh-points li{line-height:1.45}
.lh-list{list-style:none;margin:2px 0;padding:0;display:grid;gap:5px}
.lh-list li{display:flex;align-items:baseline;gap:8px;font-size:12.5px;line-height:1.4}
.lh-key{flex:none;min-width:96px}
.lh-list kbd{margin-left:auto;flex:none}
.lh kbd{font:10.5px/1.4 var(--mono);padding:1px 5px;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;background:var(--panel);color:var(--muted);white-space:nowrap}
.lh-q{padding:0 3px;border-radius:4px;background:rgba(209,78,43,.09);color:var(--ember-deep);font-family:var(--mono);font-size:.93em}
.lh-tag{display:inline-block;padding:0 6px;border:1px solid var(--line);border-radius:999px;background:var(--panel);color:var(--ink);font:600 11.5px/1.5 var(--mono);white-space:nowrap}
.lh-acts{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:3px}
.lh-use{border:0;border-radius:999px;padding:4px 11px;background:var(--ember);color:#fff;font-size:12.5px;font-weight:600;transition:background .15s ease,transform .15s ease}
.lh-use:hover{background:var(--ember-deep)}
.lh-use:active{transform:scale(.95)}
.lh-use .lh-q,.lh-use .lh-tag{border-color:transparent;background:rgba(255,255,255,.2);color:#fff}
.lh-use.quiet{background:var(--panel);color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.lh-use.quiet:hover{box-shadow:inset 0 0 0 1px var(--ember)}
.lh-use.quiet .lh-q,.lh-use.quiet .lh-tag{background:var(--panel-2);color:var(--ink)}
.lh-use.lh-done,.lh-use.lh-done:disabled{background:var(--good);color:#fff;box-shadow:none;opacity:1;cursor:default;animation:lh-tick .3s cubic-bezier(.34,1.56,.64,1)}
@keyframes lh-tick{0%{transform:scale(.9)}60%{transform:scale(1.06)}100%{transform:none}}
.lh-link{border:0;background:none;padding:4px 2px;color:var(--ember-deep);font-size:12.5px;font-weight:600}
.lh-link:hover{text-decoration:underline}
.lh-chips{display:flex;flex-wrap:wrap;gap:6px}
.lh-chip{border:1px solid var(--line);border-radius:999px;padding:5px 11px;background:var(--panel);color:var(--ink);font-size:12.5px;transition:border-color .15s ease,background .15s ease,transform .15s ease}
.lh-chip:hover{border-color:var(--ember);background:var(--wash)}
.lh-chip:active{transform:scale(.96)}
.lh-bot.lh-typing{flex-direction:row;gap:4px;padding:11px 12px;border-radius:14px 14px 14px 4px;background:var(--panel-2)}
.lh-typing span{width:6px;height:6px;border-radius:50%;background:var(--faint);animation:lh-dot 1s infinite ease-in-out}
.lh-typing span:nth-child(2){animation-delay:.15s}
.lh-typing span:nth-child(3){animation-delay:.3s}
@keyframes lh-dot{0%,80%,100%{transform:translateY(0);opacity:.45}40%{transform:translateY(-4px);opacity:1}}

/* Ask box */
.lh-ask{display:flex;align-items:center;gap:6px;margin:0 10px;padding:4px 4px 4px 12px;border:1px solid var(--line);border-radius:999px;background:var(--panel);transition:border-color .15s ease,box-shadow .15s ease}
.lh-ask:focus-within{border-color:var(--ember);box-shadow:0 0 0 3px rgba(209,78,43,.14)}
.lh-ask input{flex:1;min-width:0;border:0;outline:0;background:transparent;padding:6px 0;font-size:13.5px}
.lh-send{display:grid;place-items:center;flex:none;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:var(--ember);color:#fff;transition:background .15s ease,transform .15s ease}
.lh-send:hover{background:var(--ember-deep)}
.lh-send:active{transform:scale(.92)}
.lh-foot{margin:0;padding:6px 12px 10px;font-size:11px;color:var(--faint);text-align:center}
.lh-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* "Show me": the control the answer names gets a short ember pulse. */
.lh-spot{outline:3px solid var(--ember)!important;outline-offset:3px;animation:lh-spot 1.2s ease-in-out 2}
@keyframes lh-spot{0%,100%{outline-color:rgba(209,78,43,1)}50%{outline-color:rgba(209,78,43,.2)}}

/* Room below the work so the last controls can scroll clear of the button. */
body.lh-on main{padding-bottom:104px}
body.lh-on.lh-sheet main{padding-bottom:max(104px,var(--lh-sheet))}

.lh-inline-row{display:none}
@media (max-width:600px){
  body.lh-on .lh-inline-row{display:block;clear:both;margin-top:10px}
  .lh-inline{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 16px 0 6px;white-space:nowrap;border:1.5px solid rgba(209,78,43,.45);border-radius:999px;background:var(--panel);color:var(--ember);font:650 14px/1 var(--sans);cursor:pointer}
  .lh-inline .lh-face{width:32px;height:32px;border-radius:50%;background:var(--ember)}
  .lh-inline.lh-poke{border-color:var(--ember);box-shadow:0 0 0 4px rgba(209,78,43,.14)}.lh-poke .lh-face{animation:lh-hop 1.5s cubic-bezier(.3,.7,.4,1) 2}
  .lh{right:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px))}
  .lh-panel{position:fixed;left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));width:auto;max-width:none;max-height:min(56vh,460px);border-radius:18px;transform-origin:bottom center}
  .lh-grab{display:block}
  .lh-head{padding-top:18px}
  .lh-open .lh-fab{opacity:0;transform:scale(.55);pointer-events:none}
  .lh-ask input{font-size:16px}
  .lh-fab{width:60px;height:60px;padding:0;justify-content:center}.lh-fab .lh-face{width:44px;height:44px}.lh-fab-label{display:none}
  .lh-nudge{bottom:74px}
}
@media (prefers-reduced-motion:reduce){
  .lh,.lh *{animation:none!important;transition:none!important}
  .lh-spot{animation:none!important}
}
