@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #05060a;
  color: #e8eaf0;
  -webkit-font-smoothing: antialiased;
}

.ms-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #05060a;
}

.ms-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ms-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
  z-index: 2;
}

/* ---------- top bar ---------- */
.ms-topbar {
  position: absolute;
  top: 18px;
  left: 320px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}
.ms-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 14px 8px 10px;
  border-radius: 12px;
}
.ms-brand-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #4ba3c7, #d968a6, #4ba3c7);
  box-shadow: 0 0 16px rgba(75,163,199,0.5);
}
.ms-brand-name {
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 13px;
}
.ms-brand-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}
.ms-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 12, 18, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 14px;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.85);
}
.ms-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #888;
}
.ms-status-dot.idle { background: #555; }
.ms-status-dot.listening { background: #ff5c8a; box-shadow: 0 0 12px #ff5c8a; animation: pulse 1s infinite; }
.ms-status-dot.speaking { background: #4ba3c7; box-shadow: 0 0 12px #4ba3c7; animation: pulse 0.7s infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ---------- chat panel (left rail) ---------- */
.ms-chat {
  position: absolute;
  top: 18px;
  left: 18px;
  bottom: 18px;
  width: 290px;
  background: rgba(10, 12, 18, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  z-index: 6;
  overflow: hidden;
}
.ms-chat-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.ms-chat-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(75,163,199,0.9);
  margin-bottom: 4px;
}
.ms-chat-time {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}
.ms-chat-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 22px;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  line-height: 1;
}
.ms-chat-close:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ms-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}
.ms-chat-body::-webkit-scrollbar { width: 4px; }
.ms-chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.ms-chat-empty {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  text-align: center;
  margin-top: 40px;
  line-height: 1.6;
}
.ms-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-msg-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.ms-msg-text {
  color: rgba(255,255,255,0.9);
}
.ms-msg-user .ms-msg-label { color: #ffd07b; }
.ms-msg-lira .ms-msg-label { color: #4ba3c7; }
.ms-msg-kiro .ms-msg-label { color: #ff8db0; }
.ms-msg-partial .ms-msg-text { color: rgba(255,255,255,0.5); font-style: italic; }

.ms-chat-toggle {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 6;
  width: 44px; height: 44px;
  background: rgba(10,12,18,0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ms-chat-toggle:hover { background: rgba(255,255,255,0.08); }

/* ---------- menu bubbles ---------- */
.ms-menu {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.ms-menu > * { pointer-events: auto; }
.ms-menu-title {
  background: linear-gradient(135deg, rgba(75,163,199,0.35), rgba(217,104,166,0.28));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 11px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: bubbleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ms-menu-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
}
.ms-menu-opt {
  background: linear-gradient(135deg, rgba(45,80,120,0.7), rgba(75,55,100,0.7));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  min-width: 280px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
  animation: bubbleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ms-menu-opt:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(75,163,199,0.6);
  background: linear-gradient(135deg, rgba(75,163,199,0.4), rgba(217,104,166,0.35));
}
.ms-menu-opt:disabled { opacity: 0.4; cursor: not-allowed; }
.ms-menu-opt.ms-menu-back {
  background: rgba(20, 24, 32, 0.7);
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}
@keyframes bubbleIn {
  from { transform: translateY(20px) scale(0.92); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- mic ---------- */
.ms-mic-wrap {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ms-mic {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: linear-gradient(135deg, rgba(40,45,58,0.95), rgba(20,24,32,0.95));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
}
.ms-mic:hover:not(:disabled) {
  border-color: rgba(75,163,199,0.8);
  transform: scale(1.05);
}
.ms-mic.recording {
  background: linear-gradient(135deg, #ff5c8a, #d968a6);
  border-color: #ff8db0;
  box-shadow: 0 10px 40px rgba(255, 92, 138, 0.6);
}
.ms-mic.disabled { opacity: 0.4; cursor: not-allowed; }
.ms-mic-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #ff5c8a;
  animation: micPulse 1.2s infinite;
}
@keyframes micPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}
.ms-mic-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
}

/* ---------- welcome overlay ---------- */
.ms-welcome {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(5,6,10,0.6), rgba(5,6,10,0.92));
  backdrop-filter: blur(8px);
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ms-welcome-card {
  max-width: 520px;
  padding: 40px 44px;
  background: rgba(15, 18, 26, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.ms-welcome-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(75,163,199,0.9);
  margin-bottom: 18px;
}
.ms-welcome-card h1 {
  font-size: 36px;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.ms-welcome-card p {
  margin: 0 0 28px;
  color: rgba(255,255,255,0.7);
  line-height: 1.55;
  text-wrap: pretty;
}
.ms-welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #4ba3c7, #d968a6);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 12px 30px rgba(75,163,199,0.35);
}
.ms-welcome-cta:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(75,163,199,0.5); }
.ms-welcome-hint {
  margin-top: 18px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

/* responsive nudge */
@media (max-width: 900px) {
  .ms-chat { width: 240px; }
  .ms-topbar { left: 268px; }
  .ms-menu-opt { min-width: 240px; }
}
