/* Alfred, the on-screen assistant (shell/alfred.js). The character itself is the original Alfred, rendered in a
   shadow root by alfred-ui.js; this sheet styles only the command panel, in the original's obsidian-and-gold look. */
#alfred{position:fixed!important;right:16px!important;bottom:16px!important;top:auto!important;left:auto!important;z-index:9000!important;display:flex;flex-direction:column;align-items:flex-end;gap:6px;font:12.5px/1.45 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;color:#f1f5f9;pointer-events:none;max-width:calc(100vw - 24px);max-height:calc(100vh - 68px)}
#alfred>*{pointer-events:auto}
/* pages style bare buttons/inputs globally; keep Alfred's own look */
#alfred button,#alfred input,#alfred select{margin:0;box-sizing:border-box;font:inherit;color:inherit}
#alfred .alf-stage{pointer-events:none;outline:none}
#alfred .alf-stage:focus-visible{outline:2px solid #fbbf24;outline-offset:2px;border-radius:16px}
#alfred .alf-panel{display:none;width:340px;max-height:min(440px,62vh);flex-direction:column;background:rgba(2,6,24,.9);-webkit-backdrop-filter:blur(24px);backdrop-filter:blur(24px);border:1px solid rgba(251,191,36,.35);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,.45);overflow:hidden}
#alfred.open .alf-panel{display:flex}
/* desktop: the open panel sits beside the figure, so the widget stays short enough to lift clear of page controls */
@media(min-width:701px){#alfred.open{flex-direction:row;align-items:flex-end}}
/* floating minimize & settings buttons on the expanded figure */
#alfred .alf-min{position:absolute;top:0;right:0;width:22px;height:22px;border-radius:50%;border:1px solid rgba(251,191,36,.5);background:rgba(2,6,24,.85);color:#fcd34d;font-size:14px;line-height:18px;padding:0;cursor:pointer}
#alfred .alf-min:hover{background:#0f172b;color:#fff}
#alfred .alf-fab-gear{position:absolute;top:0;right:26px;height:22px;border-radius:999px;border:1px solid rgba(251,191,36,.55);background:rgba(2,6,24,.88);color:#fde68a;font-size:10.5px;font-weight:700;line-height:18px;padding:0 8px;cursor:pointer;display:inline-flex;align-items:center;gap:4px;box-shadow:0 4px 12px rgba(0,0,0,.35)}
#alfred .alf-fab-gear:hover{background:#0f172b;color:#fff;border-color:#fbbf24}
#alfred.docked .alf-fab-gear{display:none}
.alf-header-keys-btn{display:inline-flex;align-items:center;gap:5px;border:1px solid rgba(251,191,36,.55);border-radius:999px;background:#0f172b;color:#fde68a;padding:5px 11px;font:600 12px/1.2 'Inter',system-ui,sans-serif;cursor:pointer;margin-right:6px;transition:background .15s,border-color .15s}
.alf-header-keys-btn:hover{background:#1e293b;border-color:#fbbf24;color:#fff}
#alfred .alf-head{display:flex;align-items:center;gap:6px;padding:9px 12px;border-bottom:1px solid rgba(51,65,85,.8)}
#alfred .alf-head b{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#fcd34d}
#alfred .alf-brain{font-size:10px;color:#94a3b8;margin-right:auto;text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#alfred .alf-voice-model{max-width:118px;background:#0f172b;border:1px solid rgba(251,191,36,.35);border-radius:7px;padding:2px 5px;font-size:10px;color:#fde68a;cursor:pointer;outline:none}
#alfred .alf-voice-model:focus{border-color:#fbbf24}
#alfred .alf-gear[aria-expanded=true]{color:#fbbf24}
/* Centered middle-of-the-page modal for Voice & API Key Settings (ElevenLabs & Google Gemini) */
.alf-settings-backdrop{position:fixed;inset:0;z-index:9500;display:none;place-items:center;background:rgba(2,6,24,.68);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);padding:16px;font:12.5px/1.45 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;color:#f1f5f9}
.alf-settings-backdrop.open{display:grid}
.alf-settings-backdrop button,.alf-settings-backdrop input,.alf-settings-backdrop select{margin:0;box-sizing:border-box;font:inherit;color:inherit}
.alf-settings{display:flex;flex-direction:column;gap:10px;width:min(520px,calc(100vw - 24px));max-height:min(88vh,680px);overflow-y:auto;padding:18px 20px;border-radius:18px;border:1.5px solid rgba(251,191,36,.5);background:rgba(6,11,28,.97);box-shadow:0 30px 60px -12px rgba(0,0,0,.72),0 0 0 1px rgba(251,191,36,.18);font-size:12px;color:#f1f5f9}
.alf-settings-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:8px;border-bottom:1px solid rgba(51,65,85,.85)}
.alf-settings-head h3{margin:0;font-size:14px;font-weight:700;color:#fcd34d;letter-spacing:.03em}
.alf-settings-head p{margin:2px 0 0;font-size:11px;color:#94a3b8}
.alf-settings .alf-settings-close{border:1px solid rgba(251,191,36,.35);background:#0f172b;color:#cbd5e1;width:28px;height:28px;border-radius:8px;font-size:16px;cursor:pointer;display:grid;place-items:center}
.alf-settings .alf-settings-close:hover{color:#fff;border-color:#fbbf24}
.alf-settings label{display:flex;flex-direction:column;gap:4px;color:#cbd5e1;font-size:11px;font-weight:500}
.alf-settings input[type=password],.alf-settings input[type=text],.alf-settings select{background:#0f172b;border:1px solid #334155;border-radius:8px;padding:7px 10px;color:#f8fafc;font-size:12px;width:100%}
.alf-settings input:focus,.alf-settings select:focus{outline:none;border-color:#fbbf24;box-shadow:0 0 0 2px rgba(251,191,36,.2)}
.alf-cfg-keybox{padding:10px 12px;border-radius:12px;background:rgba(15,23,43,.85);border:1px solid rgba(251,191,36,.28);display:flex;flex-direction:column;gap:8px}
.alf-cfg-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.alf-cfg-inline{display:flex;gap:6px;align-items:center}
.alf-cfg-btn{border:1px solid rgba(251,191,36,.45);background:rgba(251,191,36,.14);color:#fde68a;border-radius:8px;padding:6px 11px;font-size:11.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.alf-cfg-btn:hover{background:rgba(251,191,36,.28);color:#fff}
.alf-cfg-btn.primary{background:linear-gradient(90deg,#fbbf24,#f59e0b);color:#020618;border:0;font-weight:700}
.alf-cfg-presets{display:flex;gap:6px}
.alf-cfg-presets button{flex:1;border:1px solid #334155;background:#0f172b;color:#cbd5e1;border-radius:8px;padding:5px 8px;font-size:11px;cursor:pointer}
.alf-cfg-presets button.active{border-color:#fbbf24;background:rgba(251,191,36,.2);color:#fde68a;font-weight:600}
.alf-cfg-status{font-size:11px;color:#fcd34d;min-height:15px}
#alfred .alf-icon{border:0;background:none;cursor:pointer;font-size:14px;padding:2px 4px;color:#cbd5e1}
#alfred .alf-icon:hover{color:#fff}
#alfred .alf-step{font-size:19px;line-height:1;padding:0 6px;border-radius:8px;color:#fcd34d}
#alfred .alf-step:hover{background:rgba(251,191,36,.15)}
#alfred .alf-log{flex:1;overflow-y:auto;padding:10px 12px;display:flex;flex-direction:column;gap:6px;min-height:110px}
#alfred .alf-user{align-self:flex-end;background:rgba(251,191,36,.18);border:1px solid rgba(251,191,36,.4);color:#fef3c7;border-radius:12px 12px 3px 12px;padding:5px 10px;max-width:85%}
#alfred .alf-alfred{align-self:flex-start;background:rgba(15,23,43,.85);border:1px solid #1d293d;border-radius:12px 12px 12px 3px;padding:5px 10px;max-width:90%}
#alfred .alf-action{font:10.5px ui-monospace,SFMono-Regular,Menlo,monospace;color:#94a3b8;padding-left:4px}
#alfred .alf-action.pending{color:#7dd3fc}
#alfred .alf-action.done::after{content:" ✓";color:#34d399}
#alfred .alf-action.failed{color:#fca5a5}
#alfred .alf-action.failed::after{content:" ✗"}
#alfred .alf-chips{display:flex;flex-wrap:wrap;gap:5px;padding:2px 0 2px 2px}
#alfred .alf-chip{border:1px solid rgba(251,191,36,.4);background:rgba(251,191,36,.08);color:#fde68a;border-radius:999px;padding:3px 9px;font-size:11px;cursor:pointer;text-align:left}
#alfred .alf-chip:hover{background:rgba(251,191,36,.2);color:#fff}
#alfred .alf-system{font-size:10.5px;color:#fcd34d;text-align:center}
#alfred .alf-input{display:flex;gap:5px;padding:8px;border-top:1px solid rgba(51,65,85,.8)}
#alfred .alf-input input{flex:1;min-width:0;background:#0f172b;border:1px solid #314158;border-radius:10px;padding:6px 9px;color:#f1f5f9}
#alfred .alf-input input::placeholder{color:#64748b}
#alfred .alf-input input:focus{outline:none;border-color:#fbbf24}
#alfred .alf-send{border:0;border-radius:10px;background:linear-gradient(90deg,#fbbf24,#f59e0b);color:#020618;font-weight:800;padding:0 13px;cursor:pointer}
#alfred .alf-send:hover{filter:brightness(1.1)}
#alfred .alf-foot{font-size:10px;color:#64748b;padding:0 12px 8px}

/* minimized: a compact avatar in the bottom-right corner (click to expand); never overlaps the top header */
#alfred.docked{top:auto!important;right:16px;bottom:16px!important;flex-direction:column;gap:6px}
#alfred.docked .alf-stage{zoom:.38!important}
#alfred.docked .alf-min{display:none}
/* while listening: a clear Stop button above the figure, visible with or without the panel */
#alfred .alf-stop{display:inline-flex;align-items:center;gap:7px;border:1px solid rgba(251,191,36,.6);border-radius:999px;background:rgba(2,6,24,.9);color:#fde68a;padding:6px 12px 6px 10px;font-weight:600;cursor:pointer;box-shadow:0 8px 20px -8px rgba(0,0,0,.45)}
#alfred .alf-stop[hidden]{display:none}
#alfred .alf-stop span{width:9px;height:9px;border-radius:2px;background:#f87171;box-shadow:0 0 0 0 rgba(248,113,113,.6);animation:alfRec 1.2s ease-out infinite}
#alfred .alf-stop:hover{background:#0f172b;color:#fff}
@keyframes alfRec{70%{box-shadow:0 0 0 7px rgba(248,113,113,0)}100%{box-shadow:0 0 0 0 rgba(248,113,113,0)}}
#alfred .alf-mic[aria-pressed=true]{color:#f87171}

/* evidence spotlight when Alfred points at the viewer */
.alf-spot{outline:3px solid #fbbf24!important;outline-offset:2px;box-shadow:0 0 0 6px rgba(251,191,36,.28)!important;border-radius:8px;animation:alfSpot 1.1s ease-in-out infinite}
@keyframes alfSpot{50%{outline-color:#f59e0b;box-shadow:0 0 0 10px rgba(251,191,36,.08)!important}}
/* smooth walking transition when Alfred walks across the screen to point at controls or the chat/text box */
#alfred.alf-walking-move{transition:transform .68s cubic-bezier(.22,1,.36,1)}
/* floating Butler pointer callout badge shown next to the highlighted element */
#alfred-pointer{position:fixed;z-index:9005;pointer-events:none;background:rgba(2,6,24,.94);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);border:1.5px solid #fbbf24;color:#fef3c7;border-radius:12px;padding:7px 12px;font:600 12px/1.35 'Inter','Segoe UI',system-ui,sans-serif;box-shadow:0 14px 30px -6px rgba(0,0,0,.55),0 0 0 3px rgba(251,191,36,.22);max-width:290px;display:flex;align-items:center;gap:7px;transition:opacity .2s,transform .2s}
#alfred-pointer[hidden]{display:none}
#alfred-pointer .alf-ptr-arrow{font-size:15px;line-height:1}
/* subtle emerald indicator on mic button when Always-Listening standby is active */
#alfred.always-listening .alf-mic:not([aria-pressed=true]){color:#34d399;text-shadow:0 0 8px rgba(52,211,153,.5)}

/* Chat on narrow screens keeps its composer across the bottom; lift Alfred above it on narrow viewports only */
@media(max-width:900px){#alfred[data-page=chat]{bottom:76px!important}}
@media(max-width:700px){
  #alfred{right:8px!important;bottom:8px!important}
  #alfred .alf-stage{zoom:.6}
  #alfred.docked{top:auto!important;right:8px!important;bottom:8px!important;left:auto!important}
  #alfred .alf-panel{width:calc(100vw - 16px);max-height:55vh}
}
@media(prefers-reduced-motion:reduce){#alfred *{animation:none!important;transition:none!important}}
