:root {
  --navy: #0a1525;
  --navy-mid: #0f1f35;
  --navy-light: #152a45;
  --navy-chat: #0c1a2e;
  --border: rgba(72, 140, 190, 0.35);
  --border-bright: rgba(100, 190, 230, 0.55);
  --teal: #6ecde8;
  --teal-dim: rgba(110, 205, 232, 0.7);
  --text: #e4eef8;
  --muted: #7a9ab8;
  --red-dot: #d45a5a;
  --btn-blue: #2b6ea8;
  --btn-blue-hover: #3a82be;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #060e18;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.install-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(1280px, 100%);
  margin-bottom: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(20, 50, 85, 0.95), rgba(12, 30, 55, 0.98));
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

.install-banner.hidden { display: none; }

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
}

.install-banner-text strong {
  color: var(--text);
  font-size: 14px;
}

.install-btn {
  background: var(--btn-blue);
  border: 1px solid rgba(100, 170, 230, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.install-dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}

/* Chenar decorativ exterior */
.frame {
  position: relative;
  width: min(1280px, 100%);
  height: min(820px, calc(100vh - 24px));
  background: var(--navy);
  border: 1px solid var(--border);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), inset 0 0 80px rgba(10, 30, 60, 0.4);
}

.frame-corner {
  position: absolute;
  width: 48px;
  height: 48px;
  border-color: var(--border-bright);
  border-style: solid;
  z-index: 5;
  pointer-events: none;
}
.frame-corner.tl { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.frame-corner.tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; }
.frame-corner.bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; }
.frame-corner.br { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 30%) 1fr;
  height: 100%;
}

/* ===== STÂNGA ===== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(30, 70, 120, 0.25) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(20, 50, 90, 0.2) 0%, transparent 45%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 18px, rgba(80, 140, 190, 0.04) 18px, rgba(80, 140, 190, 0.04) 19px);
  pointer-events: none;
}

.portrait-stack {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ornament-ring {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  animation: slow-spin 60s linear infinite;
  pointer-events: none;
}

.portrait-glow {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 160, 220, 0.15) 0%, transparent 70%);
  transition: 0.4s;
}

.avatar-switch {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin: 0.6rem 0 0.2rem;
  z-index: 2;
}
.avatar-btn {
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: #d7e7f5;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.avatar-btn:hover {
  border-color: rgba(95, 212, 154, 0.55);
  color: #fff;
}
.avatar-btn.active {
  background: rgba(95, 212, 154, 0.22);
  border-color: rgba(95, 212, 154, 0.7);
  color: #9ff0c4;
  font-weight: 600;
}

.portrait-face {
  position: relative;
  width: 200px;
  height: 200px;
  z-index: 2;
}

.portrait-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  border: 3px solid rgba(90, 160, 210, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: 0.3s;
  display: block;
}

.mouth-talk {
  position: absolute;
  left: 50%;
  bottom: 31%;
  transform: translateX(-50%);
  width: 42px;
  height: 6px;
  background: rgba(45, 22, 12, 0.75);
  border-radius: 40% / 60%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 4;
}

.hero.speaking .mouth-talk {
  opacity: 1;
  animation: mouth-move 0.11s ease-in-out infinite alternate;
}

@keyframes mouth-move {
  0%   { height: 5px;  width: 40px; border-radius: 50%; }
  35%  { height: 14px; width: 30px; border-radius: 45% / 65%; }
  70%  { height: 8px;  width: 36px; border-radius: 50%; }
  100% { height: 18px; width: 26px; border-radius: 40% / 70%; }
}

.snowflake {
  position: absolute;
  color: rgba(110, 200, 230, 0.35);
  font-size: 14px;
  z-index: 3;
}
.snowflake.s1 { top: 5%; left: 12%; }
.snowflake.s2 { top: 8%; right: 10%; }
.snowflake.s3 { bottom: 12%; left: 8%; }
.snowflake.s4 { bottom: 10%; right: 12%; }

.hero.listening .portrait-glow { background: radial-gradient(circle, rgba(110, 205, 232, 0.35) 0%, transparent 70%); }
.hero.listening .portrait-img { box-shadow: 0 0 35px rgba(110, 205, 232, 0.5); }
.hero.thinking .portrait-img { border-color: rgba(212, 90, 90, 0.5); }
.hero.speaking .portrait-img {
  box-shadow: 0 0 40px rgba(110, 205, 232, 0.6);
}

.name-plate {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(90deg, transparent, rgba(12, 28, 50, 0.95) 20%, rgba(12, 28, 50, 0.95) 80%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.name-plate h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #f0f6fc;
  text-indent: 0.22em;
}

.motto {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.motto em {
  color: var(--red-dot);
  font-style: normal;
  margin: 0 6px;
}

.hero-detail {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--teal-dim);
  min-height: 18px;
}

/* ===== DREAPTA ===== */
.workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--navy-mid);
}

.top-stats {
  display: flex;
  justify-content: flex-end;
  gap: 36px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 22, 40, 0.8);
  flex-shrink: 0;
}

.staging-badge {
  flex-shrink: 0;
  text-align: center;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #1a1200;
  background: repeating-linear-gradient(
    45deg, #ffb300, #ffb300 12px, #1a1200 12px, #1a1200 24px
  );
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.staging-badge.hidden { display: none; }

.stat { text-align: right; }
#conn-text.conn-ok { color: #5fd49a; }
#conn-text.conn-bad { color: #e07070; }
.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 3px;
}
.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
}

.chat-box {
  flex: 1;
  min-height: 0;
  padding: 18px 24px 10px;
  background: var(--navy-chat);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 8px 4px 4px;
}

.messages::-webkit-scrollbar { width: 6px; }
.messages::-webkit-scrollbar-thumb { background: rgba(80, 140, 190, 0.35); border-radius: 3px; }

.msg {
  max-width: 92%;
  padding: 12px 16px;
  border-radius: 12px;
  animation: fade-up 0.25s ease;
  border: 1px solid transparent;
}

.msg .role {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.msg .content {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #1a4a72, #1e3a5f);
  border-color: rgba(90, 160, 220, 0.35);
}
.msg.user .role { color: #8ec8f0; }

.msg.assistant {
  align-self: flex-start;
  background: rgba(18, 32, 52, 0.95);
  border-color: rgba(80, 140, 190, 0.25);
}
.msg.assistant .role { color: var(--teal); }

.msg.system {
  align-self: center;
  max-width: 100%;
  opacity: 0.8;
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 6px 10px;
}
.msg.system .role { color: #a0b8d0; }

.quick-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 24px 0;
  flex-shrink: 0;
}

.quick-cmd {
  background: rgba(20, 45, 75, 0.55);
  border: 1px solid var(--border);
  color: var(--teal-dim);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.quick-cmd:hover {
  background: rgba(40, 80, 120, 0.5);
  border-color: var(--border-bright);
  color: var(--text);
}

.composer {
  padding: 14px 24px 12px;
  border-top: 1px solid var(--border);
  background: rgba(10, 22, 40, 0.9);
  flex-shrink: 0;
}

.input-line {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(6, 14, 28, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 3px;
  outline: none;
}
#chat-input:focus {
  border-color: var(--border-bright);
}

.btn-icon {
  width: 44px;
  background: rgba(20, 45, 75, 0.8);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 17px;
  flex-shrink: 0;
  transition: 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.btn-icon:hover {
  background: rgba(40, 80, 120, 0.6);
  border-color: var(--border-bright);
}

/* Activ = inregistrare: rosu/portocaliu clar, nu doar un border usor */
.btn-icon.active {
  background: rgba(180, 50, 40, 0.85) !important;
  border-color: #ff6b4a !important;
  box-shadow: 0 0 0 2px rgba(255, 100, 70, 0.45), 0 0 18px rgba(255, 80, 50, 0.55);
  animation: mic-rec-pulse 0.9s ease-in-out infinite;
  transform: scale(1.06);
}

.btn-icon.mic-error {
  background: rgba(120, 40, 40, 0.9) !important;
  border-color: #f66 !important;
  box-shadow: 0 0 12px rgba(255, 60, 60, 0.4);
}

.btn-icon.always-on {
  background: rgba(30, 90, 60, 0.7);
  border-color: rgba(80, 200, 140, 0.6);
  box-shadow: 0 0 12px rgba(60, 180, 120, 0.35);
  animation: mic-pulse 2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(60, 180, 120, 0.25); }
  50% { box-shadow: 0 0 16px rgba(60, 180, 120, 0.5); }
}

@keyframes mic-rec-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 100, 70, 0.35), 0 0 12px rgba(255, 80, 50, 0.4); }
  50% { box-shadow: 0 0 0 3px rgba(255, 120, 80, 0.55), 0 0 22px rgba(255, 80, 50, 0.7); }
}

.btn-send {
  padding: 0 22px;
  background: var(--btn-blue);
  border: 1px solid rgba(100, 170, 230, 0.4);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.15s;
}
.btn-send:hover { background: var(--btn-blue-hover); }

.composer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}

.voice-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.meta-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.btn-stop-voice {
  background: rgba(120, 30, 30, 0.7);
  border: 1px solid rgba(220, 90, 90, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.15s;
}
.btn-stop-voice:hover { background: rgba(150, 40, 40, 0.85); }
.btn-stop-voice.hidden { display: none; }

.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 28px;
  border-top: 1px solid var(--border);
  background: rgba(8, 18, 32, 0.95);
  flex-shrink: 0;
}

.bottom-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.bottom-clock {
  font-size: 11px;
  color: var(--muted);
}

@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.secure-banner {
  width: min(1280px, 100%);
  margin-bottom: 8px;
  padding: 12px 14px;
  background: rgba(90, 50, 20, 0.9);
  border: 1px solid rgba(240, 160, 80, 0.6);
  border-radius: 6px;
  font-size: 13px;
  color: #ffe8d0;
  flex-shrink: 0;
}
.secure-banner.hidden { display: none; }
.secure-banner a { color: #6ecde8; font-weight: 700; }

.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.install-modal.hidden { display: none; }
.install-modal-box {
  background: var(--navy-mid);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 22px;
  max-width: 340px;
  width: 100%;
}
.install-modal-box h3 { color: var(--teal); margin-bottom: 12px; }
.install-modal-box ol { padding-left: 18px; color: var(--text); font-size: 14px; line-height: 1.6; }
.install-modal-close {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--btn-blue);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 860px) {
  body {
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    height: 100dvh;
    height: 100svh;
  }

  .secure-banner,
  .install-banner {
    margin: 0;
    border-radius: 0;
    font-size: 12px;
    padding: 10px 12px;
  }

  .install-btn { padding: 8px 10px; font-size: 11px; }

  .frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .frame-corner { display: none; }

  .layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .hero {
    border: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 10px;
    gap: 8px;
    flex-shrink: 0;
    min-height: 0;
  }

  .hero-bg-pattern,
  .snowflake,
  .ornament-ring,
  .name-plate,
  .motto { display: none !important; }

  .portrait-stack {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .portrait-face,
  .portrait-img {
    width: 44px;
    height: 44px;
    border-width: 2px;
  }

  .mouth-talk { bottom: 27%; width: 14px; height: 3px; }

  .hero-detail {
    display: block !important;
    flex: 1;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .workspace {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .top-stats {
    gap: 6px;
    padding: 6px 10px;
    justify-content: flex-start;
    flex-shrink: 0;
  }

  .stat { text-align: left; min-width: 0; }
  .stat:nth-child(2),
  .stat:nth-child(3) { display: none; }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 11px; }

  .chat-box {
    flex: 1;
    min-height: 0;
    padding: 8px 10px 4px;
    overflow: hidden;
  }

  .messages { gap: 6px; }
  .msg { padding: 8px 10px; }
  .msg .content { font-size: 13px; }

  .quick-cmds {
    padding: 6px 10px 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex-shrink: 0;
    max-height: 36px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .quick-cmds::-webkit-scrollbar { display: none; }
  .quick-cmd { font-size: 10px; padding: 4px 8px; }

  .composer {
    flex-shrink: 0;
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }

  .input-line { gap: 6px; }

  #chat-input {
    padding: 12px 10px;
    font-size: 16px;
    min-height: 44px;
  }

  .btn-icon {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
  }

  .btn-send {
    padding: 0 12px;
    font-size: 10px;
    min-height: 44px;
    letter-spacing: 0.04em;
  }

  .composer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
  }

  .voice-check { font-size: 11px; }
  .meta-hint {
    font-size: 10px;
    text-align: left;
    line-height: 1.3;
  }

  .bottom-bar { display: none; }
}

@media (max-width: 380px) {
  .quick-cmds { display: none; }
  .install-banner-text span { display: none; }
  .composer-meta label:nth-child(2) { display: none; }
}

.toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  background: rgba(20, 45, 75, 0.6);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.toolbar-btn.active {
  color: var(--teal);
  border-color: var(--border-bright);
  background: rgba(43, 110, 168, 0.25);
}

.panel { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.panel.hidden { display: none; }
#panel-chat .chat-box { flex: 1; min-height: 0; }
/* panel-system nu are propriul lui scroll intern (spre deosebire de .chat-box/.info-list) -
   .panel de mai sus taie orice depaseste inaltimea alocata (overflow:hidden), fara scrollbar,
   fara eroare in consola. Continutul existent (Server+PC) umple deja aproape tot spatiul, deci
   orice sectiune noua adaugata la coada (ex. Cost cumulat) devine invizibila si de neatins din
   UI - reprodus cu Playwright: DOM avea valorile corecte, dar screenshot-ul se oprea exact unde
   incepea sectiunea noua. */
#panel-system { overflow-y: auto; }

.panel-title {
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--teal);
  padding: 12px 14px 6px;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 14px 4px;
}

.info-list {
  list-style: none;
  padding: 0 14px;
  margin: 0;
  max-height: 180px;
  overflow-y: auto;
}

.info-list li {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(12, 28, 48, 0.8);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.history-list { max-height: 220px; }
.hist-user { border-left: 3px solid #4a8fc4; }
.hist-assistant { border-left: 3px solid #6ecde8; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  font-size: 13px;
  gap: 10px;
}

.setting-row select {
  flex: 1;
  max-width: 220px;
  background: var(--navy-chat);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 4px;
}

.routines-list {
  list-style: none;
  padding: 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.routine-btn, .btn-secondary {
  background: var(--btn-blue);
  border: 1px solid var(--border);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.btn-secondary {
  margin: 12px 14px;
  background: transparent;
  color: var(--muted);
}

.sys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 14px;
}

.sys-card {
  background: rgba(12, 28, 48, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sys-card span { font-size: 11px; color: var(--muted); }
.sys-card strong { font-size: 16px; color: var(--teal); }

.sys-audio-line {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
}

.portrait-face.speaking .mouth-talk {
  animation: talk-mouth 0.35s ease-in-out infinite alternate;
}

@keyframes talk-mouth {
  from { transform: scaleY(0.3); opacity: 0.5; }
  to { transform: scaleY(1); opacity: 1; }
}

/* ===== UI MINIMAL (v27) ===== */
body.minimal-ui .layout {
  grid-template-columns: 72px 1fr;
}

body.minimal-ui .hero {
  padding: 12px 8px;
  gap: 8px;
}

body.minimal-ui .hero-bg-pattern,
body.minimal-ui .ornament-ring,
body.minimal-ui .snowflake,
body.minimal-ui .name-plate,
body.minimal-ui .hero-detail,
body.minimal-ui .motto {
  display: none !important;
}

body.minimal-ui .portrait-stack {
  width: 56px;
  height: 56px;
}

body.minimal-ui .portrait-face,
body.minimal-ui .portrait-img {
  width: 48px;
  height: 48px;
}

body.minimal-ui .mouth-talk {
  display: none;
}

body.minimal-ui .chat-box {
  min-height: 62vh;
}

body.minimal-ui .messages {
  font-size: 15px;
  line-height: 1.55;
}

body.minimal-ui .workspace {
  background: #080f18;
}