:root {
  --base-blue: #0052ff;
  --base-blue-dark: #003bb3;
  --base-blue-light: #4d8dff;
  --ink: #0b1e3a;
  --panel: rgba(8, 24, 54, 0.72);
  --panel-solid: #0b2249;
  --bubble-cat: #ffffff;
  --bubble-user: #0052ff;
  --text-dim: #b9cdf5;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  overflow: hidden;
  background: #04122e;
}

.bg {
  position: fixed; inset: 0;
  background: url("assets/office.webp") center / cover no-repeat;
  z-index: 0;
}

.overlay {
  position: fixed; inset: 0;
  background: linear-gradient(180deg, rgba(3, 12, 32, 0.55) 0%, rgba(3, 12, 32, 0.25) 40%, rgba(3, 12, 32, 0.72) 100%);
  z-index: 1;
}

.app {
  position: relative; z-index: 2;
  height: 100dvh;
  max-width: 860px;
  margin: 0 auto;
  display: flex; flex-direction: column;
  padding: 14px 16px;
  gap: 10px;
}

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-cat { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.brand-name { font-weight: 800; letter-spacing: 1.5px; font-size: 20px; line-height: 1; }
.brand-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.lang-switch { display: flex; gap: 6px; background: var(--panel); padding: 4px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); }
.lang-btn {
  border: 0; cursor: pointer; background: transparent; color: #fff;
  font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px;
}
.lang-btn.active { background: var(--base-blue); }

/* ---------- ticker ---------- */
.ticker {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px; min-height: 30px;
}
.ticker::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; gap: 6px; align-items: baseline;
  background: var(--panel); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; white-space: nowrap;
}
.chip b { letter-spacing: .4px; }
.chip .up { color: #3ddc84; } .chip .down { color: #ff6b6b; }

/* ---------- stage / cat ---------- */
.stage { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 2px; }
.cat-wrap { position: relative; width: 190px; height: 190px; }
.cat {
  width: 190px; height: 190px; border-radius: 50%; object-fit: cover;
  border: 4px solid #fff; box-shadow: 0 10px 34px rgba(0,0,0,.5);
  background: #fff; display: block;
}
.cat-wrap.idle .cat { animation: bob 3.2s ease-in-out infinite; }
.cat-wrap.listening .cat { animation: listenPulse 1.1s ease-in-out infinite; }
.cat-wrap.thinking .cat { animation: think 1.4s ease-in-out infinite; }
.cat-wrap.talking .cat { animation: talkBounce .45s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes listenPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes think { 0%,100% { transform: rotate(0deg); } 25% { transform: rotate(-2.5deg); } 75% { transform: rotate(2.5deg); } }
@keyframes talkBounce { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.02); } }

.ring {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55); opacity: 0; pointer-events: none;
}
.cat-wrap.listening .ring { opacity: 1; animation: ringPulse 1.1s ease-out infinite; }
@keyframes ringPulse { 0% { transform: scale(.96); opacity: .8; } 100% { transform: scale(1.14); opacity: 0; } }

.status { font-size: 12px; color: var(--text-dim); letter-spacing: .4px; }
.status .dot { color: #3ddc84; }

.bubble {
  max-width: 640px; background: var(--bubble-cat); color: var(--ink);
  border-radius: 18px; padding: 12px 16px; font-size: 15px; line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); cursor: pointer; position: relative;
  white-space: pre-wrap; word-break: break-word;
}
.bubble::before {
  content: ""; position: absolute; top: -7px; left: 50%; margin-left: -8px;
  border: 8px solid transparent; border-bottom-color: #fff; border-top: 0;
}

/* ---------- chat ---------- */
.chat {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding: 6px 2px; scrollbar-width: thin;
}
.msg { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: var(--bubble-user); color: #fff; border-bottom-right-radius: 4px; }
.msg.cat { align-self: flex-start; background: rgba(255,255,255,.96); color: var(--ink); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--text-dim); font-size: 12.5px; text-align: center; }

.price-card {
  align-self: flex-start; background: #0e2a5c; border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; padding: 12px 14px; max-width: 82%; font-size: 14px;
}
.price-card .pc-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.price-card .pc-price { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.price-card .pc-meta { color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }
.price-card .pc-change.up { color: #3ddc84; } .price-card .pc-change.down { color: #ff6b6b; }
.price-card a { color: var(--base-blue-light); }

/* ---------- composer ---------- */
.composer { display: flex; gap: 8px; align-items: center; }
.composer input {
  flex: 1; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.94);
  color: #0b1e3a; border-radius: 999px; padding: 12px 16px; font-size: 15px; outline: none;
}
.composer input:focus { border-color: var(--base-blue-light); box-shadow: 0 0 0 3px rgba(77,141,255,.35); }
.icon-btn {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: var(--panel); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,.16); }
.icon-btn.recording { background: #e5484d; border-color: #e5484d; animation: listenPulse 1s ease-in-out infinite; }
.icon-btn.off { opacity: .45; }
.send-btn {
  flex: 0 0 auto; border: 0; cursor: pointer; background: var(--base-blue); color: #fff;
  font-weight: 700; font-size: 15px; padding: 12px 20px; border-radius: 999px;
}
.send-btn:hover { background: var(--base-blue-dark); }

.hints { display: flex; flex-wrap: wrap; gap: 6px; }
.hint {
  border: 1px solid rgba(255,255,255,.22); background: rgba(8,24,54,.55); color: #dce8ff;
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer;
}
.hint:hover { background: rgba(0,82,255,.55); }

@media (max-width: 560px) {
  .cat-wrap, .cat { width: 150px; height: 150px; }
  .msg { max-width: 88%; }
  .brand-sub { display: none; }
}
