/* Grace uses the site's existing theme and brand tokens. */
.grace-launcher{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:80;display:flex;align-items:center;gap:10px;min-height:60px;padding:12px 20px;border:0;border-radius:32px;background:#b83f14;color:#fff;box-shadow:0 8px 24px #0003;font:700 15px var(--font);cursor:pointer}
.grace-panel{position:fixed;right:max(20px,env(safe-area-inset-right));bottom:96px;z-index:81;width:min(400px,calc(100vw - 32px));max-height:calc(100dvh - 120px);background:var(--bg);color:var(--fg);border:1px solid var(--muted);border-radius:20px;box-shadow:0 16px 48px #0004;overflow:hidden;display:flex;flex-direction:column}
.grace-panel[hidden],.grace-panel [hidden]{display:none!important}
.grace-header{display:flex;align-items:center;gap:12px;padding:16px;background:#111820;color:#fff;flex-shrink:0}
.grace-header h2{font:700 22px var(--font);margin:0;color:#fff}
.grace-header p{font-size:12px;line-height:1.5;margin:2px 0 0;color:#e9edf0}
.grace-avatar{display:grid;place-items:center;width:44px;height:44px;background:#b83f14;border-radius:50%;flex-shrink:0}
#grace-close{margin-left:auto;min-width:44px;min-height:44px;background:transparent;border:1px solid #88939d;border-radius:50%;font-size:26px;color:#fff;cursor:pointer}
.grace-content{padding:16px;overflow-y:auto;overscroll-behavior:contain;font-size:14px;line-height:1.6}
.grace-content .chat{min-height:0;max-height:260px;overflow-y:auto;margin:0 0 12px;padding:0;border:0;background:transparent}
.grace-content .msg{max-width:100%;padding:12px;margin:0 0 10px;border-radius:12px;background:var(--bg);border:1px solid var(--muted)}
.grace-content .msg p{margin:0 0 6px}.grace-content .msg p:last-child{margin-bottom:0}
.grace-content .msg.me{margin-left:24px;border-color:var(--fg)}
.grace-content .askrow{display:flex;gap:8px}.grace-content .askrow input{min-width:0;width:100%}
.grace-content input,.grace-content select,.grace-content textarea{font-size:16px;min-height:44px;width:100%;box-sizing:border-box}
.grace-content .btn{min-height:44px}.grace-content .small,.grace-content .cite{font-size:12px;line-height:1.6}
.grace-content label{display:block;margin-top:10px}.grace-content #grace-finder .btn{margin-top:16px}
.grace-group{display:block;padding:12px;margin-top:10px;border:1px solid var(--muted);border-radius:10px;text-decoration:none;color:var(--fg)}
.grace-group strong,.grace-group span{display:block}.grace-group span{font-size:13px}.grace-group:hover{border-color:#b83f14}
.grace-human{margin-bottom:0}.grace-launcher:focus-visible,.grace-panel :focus-visible{outline:3px solid #00568c;outline-offset:3px}
@media(max-width:480px){.grace-panel{right:12px;bottom:88px;width:calc(100vw - 24px);max-height:calc(100dvh - 104px)}.grace-launcher{right:12px;bottom:max(12px,env(safe-area-inset-bottom));min-height:56px}.grace-content{padding:12px}}

/* phones: the launcher is a compact circle so it stops covering card text; the label stays for screen readers */
@media(max-width:480px){.grace-launcher{width:56px;height:56px;padding:0;justify-content:center;border-radius:50%}.grace-launcher>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}}
