/* Shared compact layout follows the actual panel, not device orientation. */
.secretary-composer { --sc-text:#eef6ff;--sc-muted:#7589b2;--sc-accent:#348fc9;--sc-accent2:#6650d8;--sc-border:rgba(69,171,255,.65);--sc-glass:linear-gradient(90deg,rgba(6,28,69,.92),rgba(24,25,104,.82));min-height:58px;display:grid;grid-template-columns:minmax(0,1fr) 38px 42px;align-items:center;gap:8px;padding:0;border:0;background:transparent;box-shadow:none;overflow:visible; }
html[data-home-theme="forest-glass"] .secretary-composer { --sc-text:#214f41;--sc-muted:#60766f;--sc-accent:#4aa086;--sc-accent2:#2c725f;--sc-border:rgba(55,127,104,.36);--sc-glass:linear-gradient(90deg,rgba(255,255,255,.72),rgba(213,237,229,.66)); }
.secretary-composer .secretary-input-wrap { min-width:0;display:flex;align-items:center;gap:8px;padding:5px 12px 5px 5px;border:1px solid var(--sc-border);border-radius:29px;background:var(--sc-glass);box-shadow:inset 0 1px rgba(255,255,255,.3),0 6px 18px rgba(39,87,71,.08); }
html .secretary-composer .secretary-input-wrap input { min-width:0;flex:1;width:0;padding:0;border:0!important;border-radius:0!important;outline:0;color:var(--sc-text)!important;background:transparent!important;box-shadow:none!important;font:400 13px/1.4 "Segoe UI","Microsoft YaHei",sans-serif;appearance:none; }
.secretary-composer input::placeholder {color:var(--sc-muted);opacity:1;}
.secretary-composer button:is(.secretary-submit,.secretary-mic) { box-sizing:border-box;flex-shrink:0;display:grid;place-items:center;padding:0;border-radius:50%;cursor:pointer; }
.secretary-composer .secretary-submit { width:42px;height:42px;border:1px solid rgba(126,224,255,.62);color:#fff;background:linear-gradient(145deg,var(--sc-accent),var(--sc-accent2));font:400 20px/1 "Segoe UI",sans-serif; }
.secretary-composer .secretary-mic { width:38px;height:38px;border:1px solid rgba(105,214,190,.48);color:#bff8e9;background:linear-gradient(145deg,rgba(35,132,112,.68),rgba(22,75,92,.82));box-shadow:inset 0 1px rgba(226,255,247,.16),0 4px 12px rgba(10,50,61,.25); }
.secretary-composer .secretary-mic svg {width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
.secretary-composer button:disabled {opacity:.48;cursor:wait;}
.secretary-composer .secretary-mic:is([data-state="starting"],[data-state="finalizing"]) {color:#fff0bd;border-color:rgba(255,211,109,.68);background:linear-gradient(145deg,#9d7732,#6e5a34);}
.secretary-composer .secretary-mic:is([data-state="listening"],[data-state="recognizing"]) {color:#f0fff9;border-color:rgba(166,255,221,.9);background:linear-gradient(145deg,#29a17f,#246e82);animation:secretary-mic-pulse 1.25s ease-in-out infinite;}
.secretary-composer .secretary-mic[data-state="error"] {color:#ffdce4;border-color:rgba(255,120,150,.65);background:rgba(132,44,67,.82);}
@keyframes secretary-mic-pulse {50% {box-shadow:0 0 0 4px rgba(63,218,176,.14);}}
@container secretary (max-width:440px) {
 .secretary-composer {min-height:52px;grid-template-columns:minmax(0,1fr) 34px 38px;gap:6px;}
 .secretary-composer .secretary-input-wrap {gap:6px;padding:4px 8px 4px 4px;}
 html .secretary-composer .secretary-input-wrap input {font-size:12px;}
 .secretary-composer .secretary-submit {width:38px;height:38px;}
 .secretary-composer .secretary-mic {width:34px;height:34px;}
}
@container secretary (max-height:420px) {
 .secretary-composer {min-height:40px;grid-template-columns:minmax(0,1fr) 30px 32px;gap:5px;}
 .secretary-composer .secretary-input-wrap {gap:4px;padding:3px;}
 .secretary-composer .secretary-submit {width:32px;height:32px;}
 .secretary-composer .secretary-mic {width:30px;height:30px;}
}
/* One identity treatment for web, native overlays and the Windows tray. */
:is(.nexora-agent-avatar,.assistant-logo-button) { width:44px;height:44px;flex:0 0 44px;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:transparent;box-shadow:none; }
:is(.nexora-agent-avatar img,.assistant-logo) { width:44px;height:44px;display:block;object-fit:contain;border-radius:50%;filter:none; }
.assistant-logo-button {cursor:pointer;outline-offset:2px;}
.assistant {container-type:size;container-name:secretary;}
html.secretary-covered #nexoraFloat { display: none !important; }
.nexora-float.is-modal-covered { visibility: hidden !important; pointer-events: none !important; }
.nexora-float {
  --secretary-safe-top: env(safe-area-inset-top, 0px);
  --secretary-safe-right: env(safe-area-inset-right, 0px);
  --secretary-safe-bottom: env(safe-area-inset-bottom, 0px);
  --secretary-safe-left: env(safe-area-inset-left, 0px);
}
html:not(.native-secretary-overlay) .nexora-float:not(.is-closed) {
  min-width: min(310px, var(--secretary-available-width, calc(100vw - 24px))) !important;
  max-width: var(--secretary-available-width, calc(100vw - 24px)) !important;
  min-height: min(58px, var(--secretary-available-height, calc(100dvh - 24px))) !important;
  max-height: var(--secretary-available-height, calc(100dvh - 24px)) !important;
}
.nexora-float:not(.is-agent):not(.is-expanded) > .secretary-resize-handle { display:none!important; }
.nexora-float:not(.is-agent):not(.is-expanded):not(.is-searching):not(.is-closed) { height:62px!important;min-height:0!important;max-height:62px!important;resize:none!important; }
.nexora-float.is-agent { container-type: size; container-name: secretary; }
html:not(.native-secretary-overlay) .nexora-float.is-agent {
  min-height: min(420px, var(--secretary-available-height, calc(100dvh - 24px))) !important;
}
html:not(.native-secretary-overlay) .nexora-float.is-expanded {
  min-height: min(330px, var(--secretary-available-height, calc(100dvh - 24px))) !important;
}
.nexora-float-expanded { overflow: auto; overscroll-behavior: contain; }
html.native-secretary-overlay,
html.native-secretary-overlay body {
  min-width: 0 !important;
  background: transparent !important;
  background-image: none !important;
}
html.native-secretary-overlay::before,
html.native-secretary-overlay::after,
html.native-secretary-overlay body::before,
html.native-secretary-overlay body::after { display: none !important; }
html.native-secretary-overlay #nexoraFloat {
  --secretary-overlay-glass: linear-gradient(145deg, rgba(5,20,49,.95), rgba(14,10,55,.93));
  --secretary-overlay-inset: rgba(4,18,43,.5);
  --assistant-ui-surface: transparent;
  --assistant-ui-surface-soft: rgba(13,35,76,.65);
  --assistant-ui-surface-raised: rgba(18,43,88,.75);
  --assistant-ui-input: rgba(4,16,43,.7);
  box-sizing: border-box;
  background: var(--secretary-overlay-glass) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 17px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}
/* Native hosts share the web secretary. Its surfaces keep a slight glass tint
   but stay mostly opaque: the window floats over other apps' text, which
   showed through and made the panel hard to read. Text, controls, focus and
   every existing action remain fully opaque. */
html.native-secretary-overlay[data-home-theme="forest-glass"] #nexoraFloat {
  --secretary-overlay-glass: linear-gradient(145deg, rgba(252,255,254,.96), rgba(210,234,227,.94));
  --secretary-overlay-inset: rgba(247,252,250,.6);
  --assistant-ui-surface-soft: rgba(221,240,234,.7);
  --assistant-ui-surface-raised: rgba(255,255,255,.8);
  --assistant-ui-input: rgba(255,255,255,.82);
}
html.native-secretary-overlay #nexoraAgentOutput {
  background: var(--secretary-overlay-inset) !important;
  box-shadow: none !important;
}
@container secretary (max-width: 440px) {
  .nexora-agent-head { min-height: 44px; gap: 8px; align-items: center; }
  .nexora-agent-identity { gap: 8px; }
  .nexora-agent-greeting strong { font-size: 15px; letter-spacing: 0; white-space: nowrap; }
  .nexora-agent-greeting span { margin-top: 4px; font-size: 11px; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .nexora-agent-head-actions { gap: 4px; }
}
@container secretary (max-height: 420px) {
  .nexora-agent-panel {
    min-height: 0;
    padding: 8px 10px;
    gap: 5px;
    grid-template-rows: auto auto auto minmax(32px, 1fr) auto;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .nexora-agent-panel.is-function-view { grid-template-rows: auto minmax(0, 1fr); }
  .nexora-agent-head { min-height: 36px; gap: 6px; }
  .nexora-agent-identity { gap: 7px; }
  .nexora-agent-greeting strong { font-size: 13px; white-space: nowrap; }
  .nexora-agent-greeting span { font-size: 10px; margin-top: 2px; }
  .nexora-agent-prompts .nexora-mode-button { height: 26px; padding: 0 9px; font-size: 10px; }
  .nexora-agent-live-status { min-height: 20px; padding: 2px 7px; font-size: 10px; }
  .nexora-agent-output { min-height: 0; padding: 6px 8px; }
}
@container secretary (max-width:340px) {
 .nexora-agent-greeting strong,.assistant-title strong {font-size:13px;}
}
/* Speaking flame. assets/images/icon-flame-{preparing,ready}.png hold 48
   frames of 72x84 px in an 8x6 grid, played at 24 fps. Like the Windows
   client's native flame it covers the avatar widened by 1/7 on each side and
   raised by 1/4 of its height, and the listening flame grows with the voice. */
[data-speaking-flame] { position:relative; }
.secretary-flame { position:absolute;left:-14.2857%;top:-25%;width:128.5714%;height:150%;pointer-events:none;opacity:0;transition:opacity .24s ease;background-repeat:no-repeat;background-size:800% 600%;transform-origin:50% 100%;animation:secretary-flame-x .3333s steps(8) infinite,secretary-flame-y 2s steps(6) infinite;animation-play-state:paused; }
.secretary-flame.cool { background-image:url("assets/images/icon-flame-preparing.png?v=1"); }
.secretary-flame.warm { background-image:url("assets/images/icon-flame-ready.png?v=1");transform:scaleY(calc(1 + var(--speech-level, 0) * .25));transition:opacity .24s ease,transform .12s ease-out; }
[data-flame="preparing"] > .secretary-flame.cool,[data-flame="ready"] > .secretary-flame.warm { opacity:1;animation-play-state:running; }
@keyframes secretary-flame-x { to { background-position-x:114.2857%; } }
@keyframes secretary-flame-y { to { background-position-y:120%; } }
@media (prefers-reduced-motion: reduce) { .secretary-flame { animation:none; } }

/* Mini voice bar: the agent panel shrunk to one row that keeps voice input
   running — avatar with the speaking flame, status, microphone, expand, close. */
.secretary-mini-bar { display:none; }
.nexora-float.is-agent.is-mini > :not(.nexora-agent-panel),
.nexora-float.is-agent.is-mini .nexora-agent-panel > :not(.secretary-mini-bar) { display:none !important; }
.nexora-float.is-agent.is-mini .nexora-agent-panel { display:block !important;height:100%;padding:0 !important;overflow:visible; }
html:not(.native-secretary-overlay) .nexora-float.is-agent.is-mini { width:min(340px, var(--secretary-available-width, calc(100vw - 24px))) !important;height:64px !important;min-width:0 !important;min-height:0 !important;max-height:64px !important;border-radius:32px !important;overflow:visible !important; }
html.native-secretary-overlay #nexoraFloat.is-mini { top:auto !important;bottom:0 !important;height:64px !important;border-radius:32px !important;overflow:visible !important; }
.nexora-float.is-mini .secretary-mini-bar { display:flex;align-items:center;gap:8px;height:100%;box-sizing:border-box;padding:0 6px 0 11px; }
.secretary-mini-bar .secretary-mini-avatar { width:42px;height:42px;flex:none;padding:0;border:0;border-radius:50%;background:transparent; }
.secretary-mini-avatar img { width:42px;height:42px;display:block;border-radius:50%;object-fit:contain; }
.secretary-mini-text { flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;cursor:grab;touch-action:none; }
.secretary-mini-text small { font-size:12px;opacity:.78;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.secretary-mini-text b { font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
/* While speaking the recognised text takes both lines. */
.secretary-mini-text.is-live small { display:none; }
.secretary-mini-text.is-live b { font-size:14px;line-height:1.3;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical; }
.secretary-mini-bar button { flex:none;display:grid;place-items:center;height:44px;padding:0;border:0;border-radius:22px;background:transparent;color:inherit;cursor:pointer; }
.secretary-mini-bar button svg { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.secretary-mini-bar .secretary-mini-ghost { width:40px; }
.secretary-mini-bar .secretary-mini-ghost:hover { background:rgba(127,160,255,.14); }
.secretary-mini-bar .secretary-mini-mic { width:44px;color:#fff;background:#3a6df0; }
html[data-home-theme="forest-glass"] .secretary-mini-bar .secretary-mini-mic { background:#2e7d64; }
.secretary-mini-mic .secretary-mini-stop { display:none; }
.secretary-mini-mic[aria-pressed="true"] { background:#c4561f !important;animation:secretary-mini-ring 1.1s ease-out infinite; }
.secretary-mini-mic[aria-pressed="true"] .secretary-mini-stop { display:block; }
.secretary-mini-mic[aria-pressed="true"] .secretary-mini-record { display:none; }
.secretary-mini-mic:disabled { opacity:.6;cursor:default; }
@keyframes secretary-mini-ring { from { box-shadow:0 0 0 0 rgba(196,86,31,.45); } to { box-shadow:0 0 0 10px rgba(196,86,31,0); } }
