/* Goldie on the studio homepage (goldie.js). Mounted on <body>, outside
   #gh-studio, so nothing here leans on that wrapper's tokens: the same warm
   palette is restated under #gh-goldie. Light only, like the page. */
#gh-goldie{--ghg-paper:#fffaf1;--ghg-surface:#fffdf9;--ghg-ink:#443427;--ghg-muted:#7b6859;--ghg-line:#e8dac7;--ghg-accent:#aa592f;--ghg-accent-soft:#f7d29a;--ghg-shadow:0 18px 50px rgba(68,52,39,.18),0 2px 8px rgba(68,52,39,.08);color-scheme:light;font:14px/1.5 'DM Sans',system-ui,-apple-system,sans-serif;color:var(--ghg-ink)}
#gh-goldie *{box-sizing:border-box}
#gh-goldie [hidden]{display:none!important}
#gh-goldie button{font:inherit;color:inherit;cursor:pointer}
#gh-goldie button:focus-visible,#gh-goldie a:focus-visible,#gh-goldie textarea:focus-visible{outline:3px solid #b77538;outline-offset:2px}

/* Launcher */
#gh-goldie .ghg-launcher-wrap{position:fixed;right:20px;bottom:20px;z-index:70}
#gh-goldie .ghg-launcher{display:flex;align-items:center;gap:8px;min-height:44px;padding:4px 4px 4px 16px;border:1px solid var(--ghg-line);border-radius:999px;background:var(--ghg-surface);box-shadow:var(--ghg-shadow);font-weight:600;font-size:14px;transition:transform .15s ease}
#gh-goldie .ghg-launcher:hover{transform:scale(1.03)}
#gh-goldie .ghg-launcher-face,#gh-goldie .ghg-head-face{display:inline-flex;flex:none;overflow:hidden;border-radius:28%}
#gh-goldie .ghg-launcher-face{width:44px;height:44px}
#gh-goldie .ghg-avatar-img{width:100%;height:100%;object-fit:cover;display:block}
#gh-goldie .ghg-launcher-hide{position:absolute;top:-6px;right:-6px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:5px;border:1px solid var(--ghg-line);border-radius:50%;background:var(--ghg-surface);color:var(--ghg-muted);box-shadow:0 1px 4px rgba(68,52,39,.12)}
#gh-goldie .ghg-launcher-hide:before{content:'';position:absolute;inset:-8px}
#gh-goldie .ghg-launcher-hide:hover{color:var(--ghg-ink)}
#gh-goldie .ghg-launcher-hide svg{width:12px;height:12px}

/* Greeting: Goldie speaks first. A card above the pill, the same one the
   React panel shows on the other public pages (goldie.tsx). A status, never
   focused. The rise runs only for visitors who have not asked for less
   motion, and under 400px only the pill stays beside the words. */
#gh-goldie .ghg-greeting{position:absolute;right:0;bottom:100%;margin-bottom:12px;width:288px;max-width:calc(100vw - 40px);padding:12px 32px 12px 12px;border:1px solid var(--ghg-line);border-radius:18px;background:var(--ghg-paper);box-shadow:var(--ghg-shadow);text-align:left}
@media (prefers-reduced-motion:no-preference){#gh-goldie .ghg-greeting{animation:ghg-greeting-in .4s ease-out backwards}}
@keyframes ghg-greeting-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#gh-goldie .ghg-greeting-title{margin:0;font-size:13px;font-weight:600;color:var(--ghg-ink)}
#gh-goldie .ghg-greeting-body{margin:4px 0 0;font-size:13px;line-height:1.5;color:var(--ghg-muted)}
#gh-goldie .ghg-greeting-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px}
#gh-goldie .ghg-greeting-ask{display:inline-flex;align-items:center;min-height:32px;padding:0 14px;border:0;border-radius:999px;background:var(--ghg-accent);color:#fff;font-size:13px;font-weight:600}
#gh-goldie .ghg-greeting-ask:hover{background:var(--ghg-ink)}
/* Both classes: the greeting's chips are .ghg-chip too, and the plain .ghg-chip
   rule further down (same weight, later) would otherwise win on padding and size. */
#gh-goldie .ghg-greeting-chip.ghg-chip{min-height:32px;padding:6px 12px;font-size:12px}
@media (max-width:399px){#gh-goldie .ghg-greeting-chip{display:none}}
#gh-goldie .ghg-greeting-close{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:5px;border:0;border-radius:50%;background:transparent;color:var(--ghg-muted)}
#gh-goldie .ghg-greeting-close:before{content:'';position:absolute;inset:-8px}
#gh-goldie .ghg-greeting-close:hover{color:var(--ghg-ink)}
#gh-goldie .ghg-greeting-close svg{width:12px;height:12px}

/* Panel */
#gh-goldie .ghg-panel{position:fixed;left:12px;right:12px;bottom:20px;z-index:90;display:flex;flex-direction:column;max-height:min(640px,calc(100dvh - 40px));overflow:hidden;border:1px solid var(--ghg-line);border-radius:22px;background:var(--ghg-surface);box-shadow:var(--ghg-shadow)}
@media (min-width:640px){#gh-goldie .ghg-panel{left:auto;right:24px;bottom:24px;width:380px;max-height:min(640px,calc(100dvh - 48px))}#gh-goldie .ghg-launcher-wrap{right:24px;bottom:24px}}
#gh-goldie .ghg-head{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 16px;border-bottom:1px solid var(--ghg-line);background:var(--ghg-paper)}
#gh-goldie .ghg-head-face{width:36px;height:36px}
#gh-goldie .ghg-head-titles{flex:1;min-width:0}
#gh-goldie .ghg-name{margin:0;font:22px/1 'Italiana',Georgia,serif;letter-spacing:-.4px}
#gh-goldie .ghg-sub{margin:3px 0 0;font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--ghg-muted)}
#gh-goldie .ghg-icon-button{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:8px;border:0;border-radius:50%;background:transparent;color:var(--ghg-muted)}
#gh-goldie .ghg-icon-button:hover{background:var(--ghg-line);color:var(--ghg-ink)}
#gh-goldie .ghg-icon-button svg{width:18px;height:18px}

/* Conversation */
#gh-goldie .ghg-log{flex:1;min-height:180px;overflow-y:auto;overscroll-behavior:contain;padding:16px}
#gh-goldie .ghg-empty{display:flex;flex-direction:column;gap:14px}
#gh-goldie .ghg-intro{margin:0;color:var(--ghg-ink)}
#gh-goldie .ghg-chips{display:flex;flex-wrap:wrap;gap:8px}
#gh-goldie .ghg-chip{padding:8px 12px;border:1px solid var(--ghg-line);border-radius:999px;background:var(--ghg-paper);font-size:13px;line-height:1.2;text-align:left}
#gh-goldie .ghg-chip:hover{border-color:var(--ghg-accent);color:var(--ghg-accent)}
#gh-goldie .ghg-row{display:flex;margin:0 0 12px}
#gh-goldie .ghg-row-user{justify-content:flex-end}
#gh-goldie .ghg-bubble{max-width:88%;margin:0;border-radius:18px;padding:10px 14px;overflow-wrap:anywhere}
#gh-goldie .ghg-bubble-user{background:var(--ghg-ink);color:var(--ghg-paper);border-bottom-right-radius:6px;white-space:pre-wrap}
#gh-goldie .ghg-bubble-goldie{max-width:100%;padding:2px 0;border-radius:0}
#gh-goldie .ghg-p{margin:0 0 10px;white-space:pre-wrap}
#gh-goldie .ghg-p:last-child,#gh-goldie .ghg-list:last-child,#gh-goldie .ghg-table-wrap:last-child{margin-bottom:0}
#gh-goldie .ghg-list{margin:0 0 10px;padding-left:20px}
#gh-goldie .ghg-list li{margin:0 0 4px}
#gh-goldie .ghg-table-wrap{margin:0 0 10px;overflow-x:auto}
#gh-goldie .ghg-table{width:100%;border-collapse:collapse;font-size:13px}
#gh-goldie .ghg-table th,#gh-goldie .ghg-table td{padding:6px 8px;border-bottom:1px solid var(--ghg-line);text-align:left;vertical-align:top}
#gh-goldie .ghg-table th{font-weight:600}
#gh-goldie strong{font-weight:600}
#gh-goldie .ghg-link{color:var(--ghg-accent);font-weight:500;text-decoration:underline;text-underline-offset:2px}
#gh-goldie .ghg-link:hover{color:var(--ghg-ink)}
#gh-goldie .ghg-typing{display:inline-flex;gap:4px;padding:8px 0}
#gh-goldie .ghg-typing i{width:6px;height:6px;border-radius:50%;background:var(--ghg-muted);animation:ghg-pulse 1s ease-in-out infinite}
#gh-goldie .ghg-typing i:nth-child(2){animation-delay:.12s}
#gh-goldie .ghg-typing i:nth-child(3){animation-delay:.24s}
@keyframes ghg-pulse{0%,100%{opacity:.3}50%{opacity:1}}
#gh-goldie .ghg-error{margin-top:6px;padding:10px 12px;border:1px solid var(--ghg-line);border-radius:14px;background:var(--ghg-paper)}
#gh-goldie .ghg-error p{margin:0}
#gh-goldie .ghg-retry{margin-top:8px;padding:6px 12px;border:1px solid var(--ghg-line);border-radius:999px;background:var(--ghg-surface);font-size:13px}

/* Composer */
#gh-goldie .ghg-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--ghg-line)}
#gh-goldie .ghg-input{flex:1;min-height:42px;max-height:132px;resize:none;padding:10px 14px;border:1px solid var(--ghg-line);border-radius:20px;background:var(--ghg-paper);color:var(--ghg-ink);font:inherit;font-size:16px;line-height:1.35}
#gh-goldie .ghg-input::placeholder{color:var(--ghg-muted)}
#gh-goldie .ghg-send{display:inline-flex;flex:none;align-items:center;justify-content:center;width:42px;height:42px;padding:10px;border:0;border-radius:50%;background:var(--ghg-ink);color:var(--ghg-paper)}
#gh-goldie .ghg-send svg{width:20px;height:20px}
#gh-goldie .ghg-foot{margin:0;padding:0 16px 12px;font-size:11.5px;line-height:1.4;color:var(--ghg-muted)}
#gh-goldie .ghg-foot .ghg-link{color:var(--ghg-muted)}
#gh-goldie .ghg-foot-link{padding:0;border:0;background:none;font:inherit;color:var(--ghg-muted);text-decoration:underline;text-underline-offset:2px;cursor:pointer}
#gh-goldie .ghg-foot-link:hover{color:var(--ghg-ink)}
@media (prefers-reduced-motion:reduce){#gh-goldie *{animation:none!important;transition:none!important}}

/* The FAQ's "Ask Goldie anything" link (index.html, data-goldie-open). */
#gh-studio .gh-ask-goldie{margin-left:24px}
