/* LiverStats Secretary — in-office chat (desktop drawer + iPhone full-screen). */
.fo-sec-launch {
  position: fixed; z-index: 60; right: 22px; bottom: 22px;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--grotesk, sans-serif); font-weight: 600; font-size: 14px; color: #fff;
  background: linear-gradient(120deg, rgba(168,85,247,0.95), rgba(34,211,238,0.9));
  border: 1px solid rgba(255,255,255,0.25); box-shadow: 0 8px 30px rgba(168,85,247,0.4);
}
.fo-sec-launch:hover { filter: brightness(1.08); }
.fo-sec-launch__dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }

.fo-secretary {
  position: fixed; z-index: 61; top: 0; right: 0; height: 100%; width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0a0c16 0%, #05060c 100%);
  border-left: 1px solid rgba(168,85,247,0.28); box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(103%); transition: transform .28s cubic-bezier(.22,1,.36,1);
}
body.sec-open .fo-secretary { transform: translateX(0); }

.sec-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px calc(14px);
  padding-top: calc(16px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid rgba(255,255,255,0.08); }
.sec-avatar { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  background: #000; overflow: hidden;
  display: grid; place-items: center; box-shadow: 0 0 16px rgba(168,85,247,0.5); }
.sec-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sec-id { flex: 1; min-width: 0; }
.sec-id__n { font-family: var(--grotesk, sans-serif); font-weight: 600; color: var(--text, #eaecf5); font-size: 15px; }
.sec-id__r { font-size: 11px; color: var(--muted, #8b90a8); letter-spacing: .04em; }
.sec-close { background: none; border: 1px solid rgba(255,255,255,0.14); color: var(--muted, #8b90a8);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px; }

.sec-banner { margin: 12px 16px 0; padding: 9px 12px; border-radius: 10px; font-size: 12px;
  color: #f5c518; background: rgba(245,197,24,0.1); border: 1px solid rgba(245,197,24,0.28); }

.sec-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.sec-msg { max-width: 88%; }
.sec-msg--me { align-self: flex-end; }
.sec-msg--sec { align-self: flex-start; }
.sec-text { padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.6;
  font-family: var(--grotesk, sans-serif); color: var(--text, #eaecf5); }
.sec-msg--me .sec-text { background: linear-gradient(120deg, rgba(168,85,247,0.9), rgba(94,120,255,0.85)); color: #fff; border-bottom-right-radius: 4px; }
.sec-msg--sec .sec-text { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-bottom-left-radius: 4px; }
.sec-typing { letter-spacing: 3px; opacity: .6; }

.sec-meta { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 2px 0; }
.sec-chip { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); color: var(--muted, #8b90a8); }
.sec-chip.ai { color: #a855f7; border-color: rgba(168,85,247,0.4); }
.sec-chip.noai { color: #8b90a8; }
.sec-chip.task { color: #22d3ee; border-color: rgba(34,211,238,0.4); }
.sec-chip.ceo { color: #f5c518; border-color: rgba(245,197,24,0.4); }
.sec-chip.mock { color: #04240f; background: #f59e0b; border-color: #f59e0b; font-weight: 700; } /* MOCK/test-data badge — high-visibility */
.sec-src, .sec-unv { font-size: 10.5px; color: var(--muted, #8b90a8); margin: 4px 2px 0; line-height: 1.45; }
.sec-unv { color: #d0a94a; }

.sec-quicks { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 0; }
.sec-quick { flex: 0 0 auto; font-size: 12px; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--text, #eaecf5); white-space: nowrap; }
.sec-quick:hover { background: rgba(168,85,247,0.16); }

.sec-input-row { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,255,255,0.08); }
.sec-input { flex: 1; resize: none; min-height: 42px; max-height: 120px; padding: 11px 13px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); color: var(--text, #eaecf5);
  font-family: var(--grotesk, sans-serif); font-size: 14px; line-height: 1.4; }
.sec-input:focus { outline: none; border-color: rgba(168,85,247,0.55); }
.sec-send { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: #fff; font-size: 18px;
  background: linear-gradient(120deg, rgba(168,85,247,0.95), rgba(34,211,238,0.9)); border: none; }

/* The Chief of Staff's warm arrival greeting — distinct, welcoming. */
.sec-msg--sec .sec-text.sec-greeting {
  background: linear-gradient(135deg, rgba(168,85,247,0.16), rgba(34,211,238,0.08));
  border: 1px solid rgba(168,85,247,0.32);
  font-size: 14.5px; line-height: 1.75; border-bottom-left-radius: 14px;
}
/* In-app AI connect (paste key once) */
.sec-connect-lead { margin-bottom: 9px; line-height: 1.6; }
.sec-connect-open { background: linear-gradient(120deg, rgba(168,85,247,0.95), rgba(34,211,238,0.9)); color: #fff; border: none; border-radius: 10px; padding: 9px 15px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--grotesk, sans-serif); }
.sec-connect-form { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sec-connect-input { flex: 1 1 180px; min-width: 0; font-size: 16px; padding: 10px 12px; border-radius: 9px; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.22); color: var(--text, #eaecf5); font-family: ui-monospace, monospace; }
.sec-connect-input:focus { outline: none; border-color: rgba(168,85,247,0.6); }
.sec-connect-go { flex: 0 0 auto; background: #34d399; color: #04240f; border: none; border-radius: 9px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.sec-connect-go:disabled { opacity: .6; cursor: default; }
.sec-connect-msg { flex-basis: 100%; font-size: 12px; color: var(--text, #eaecf5); }
.sec-connect-note { flex-basis: 100%; font-size: 11px; color: var(--muted, #8b90a8); opacity: .85; }
.sec-dots { opacity: .55; font-size: 12.5px; animation: sec-dots 1.4s ease-in-out infinite; }
@keyframes sec-dots { 0%,100% { opacity: .35; } 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .sec-dots { animation: none; } }

/* iPhone / narrow: full-screen "secretary room" — native feel */
@media (max-width: 640px) {
  .fo-secretary { width: 100vw; border-left: none; }
  .sec-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .sec-avatar { width: 44px; height: 44px; font-size: 22px; }
  .sec-log { padding: 16px 15px; gap: 14px; }
  .sec-msg { max-width: 90%; }
  .sec-text { font-size: 15px; }
  .sec-input { font-size: 16px; }            /* 16px = no iOS auto-zoom on focus */
  .sec-send { width: 48px; height: 48px; }   /* comfortable thumb target */
  .fo-sec-launch { right: 50%; transform: translateX(50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); font-size: 15px; padding: 14px 24px; box-shadow: 0 10px 34px rgba(168,85,247,0.5); }
  body.sec-open .fo-sec-launch { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fo-secretary { transition: none; } }
