/* Presentor UI Baseline with design tokens */
:root {
  --cs-bg: #346600;           /* dark green */
  --cs-surface: #ffffff;
  --cs-border: #e5e7eb;       /* gray-200 */
  --cs-text: #111827;         /* gray-900 */
  --cs-muted: #6b7280;        /* gray-500 */
  --cs-accent: #2563eb;       /* blue-600 */
  --cs-success: #16a34a;      /* green-600 */
  --cs-danger: #dc2626;       /* red-600 */

  --cs-font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --cs-font-size: 16px;
  --cs-line-height: 1.6;
}

body {
  background: var(--cs-bg);
  color: var(--cs-text);
  font-family: var(--cs-font-family);
  font-size: var(--cs-font-size);
  line-height: var(--cs-line-height);
}

/* Layout shell and panels */
.shell { max-width: 1100px; margin: 16px auto; padding: 12px; }
.header-bar { display:flex; gap:12px; align-items:center; justify-content:space-between; background: var(--cs-surface); border:1px solid var(--cs-border); border-radius:8px; padding:12px; }
.logo { height: 60px; width: auto; }
.panel { background: var(--cs-surface); border:1px solid var(--cs-border); border-radius:8px; padding:12px; }
.grid { display:grid; grid-template-columns: 2fr 1fr; gap:12px; }
.mt-8 { margin-top: 8px; }
.panel-title { font-weight: 600; margin-bottom: 6px; }

/* Chat container and messages */
#chat-container { height: 48vh; overflow:auto; background: var(--cs-surface); border:1px solid var(--cs-border); border-radius:6px; padding:10px; }
.message { padding: 8px 10px; margin: 8px 0; border-radius: 8px; max-width: 80%; border: 1px solid var(--cs-border); color: var(--cs-text) !important; background: var(--cs-surface); }
#chat-container .message * { color: var(--cs-text) !important; }
.message.user { background: #f7fafc !important; margin-left:auto; border-left: 4px solid var(--cs-accent); }
.message.sam { background: #f1f5f9 !important; border-left: 4px solid var(--cs-muted); }

.small { font-size: 12px; color: #64748b; }
#vars { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; }

/* Inputs and buttons */
.input-row { display:flex; gap:8px; margin-top:8px; }
.text-input { flex:1; padding:8px 10px; background: var(--cs-surface); color: var(--cs-text); border:1px solid var(--cs-border); border-radius:6px; }
.text-input::placeholder { color: var(--cs-muted); }
.btn { border:0; border-radius:6px; padding:8px 10px; cursor:pointer; }
.btn-mic { background: var(--cs-success); color:#fff; }
.btn-mic.off { background: var(--cs-danger); }
.status { margin-top:6px; color: var(--cs-muted); min-height: 56px; display:flex; align-items:center; }

/* Scoped thinking animation for status area */
#status .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
#status .cs-thinking { position: relative; width: 100px; }
#status .cs-thinking svg { width: 100%; height: auto; display: block; }
#status .cs-thinking .dots { position: absolute; display: flex; gap: 4px; }
#status .cs-thinking .dots.left { top: 46%; left: 28%; }
#status .cs-thinking .dots.right { top: 46%; left: 63%; }
#status .cs-thinking .dot { width: 8px; height: 8px; background: #0a4d66; border-radius: 50%; animation: cs-bounce 1.2s infinite; }
#status .cs-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
#status .cs-thinking .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cs-bounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1.2); opacity: 1; } }

/* Permanent Sam icon with pupils */
#status .cs-sam { position: relative; width: 115px; margin-left: 14px; overflow: visible; }
#status .cs-sam .sam-cloud { width: 100%; height: auto; display: block; transform: none; transform-origin: center; position: relative; z-index: 0; }
#status .cs-sam .eye { position: absolute; width: 16px; height: 16px; border-radius: 50%; overflow: hidden; top: var(--eye-y, 46%); transform: translate(-50%, -50%); will-change: transform; z-index: 1; }
#status .cs-sam .eye.left { left: var(--eye-left-x, 40%); }
#status .cs-sam .eye.right { left: var(--eye-right-x, 66%); }
#status .cs-sam .pupil { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; background: #0a4d66; border-radius: 50%; transform: translate(calc(-50% + var(--base-px, 0px) + var(--px, 0px)), calc(-50% + var(--base-py, 0px) + var(--py, 0px))); transition: transform 600ms ease-in-out; }

/* Pupil drift driven by CSS vars; JS updates --px/--py while thinking */

/* Optional rare blink; disabled during speaking */
#status.cs-blink .cs-sam .eye { animation: cs-blink 7s infinite; }
@keyframes cs-blink {
  0%, 96%, 100% { transform: translate(-50%, -50%) scaleY(1); }
  97%, 99%      { transform: translate(-50%, -50%) scaleY(0.1); }
}

