* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #f5f5f7;
  background:
    radial-gradient(circle at 20% 15%, rgba(76, 138, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(10, 12, 16, 0.86), rgba(20, 22, 28, 0.72));
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
button, input, select { font: inherit; }
button {
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 12px;
}
button:hover { background: rgba(255, 255, 255, 0.18); }
button:disabled { cursor: default; opacity: 0.6; }
button.primary {
  background: rgba(64, 122, 255, 0.42);
  border-color: rgba(135, 170, 255, 0.62);
}
button.recording {
  background: rgba(255, 70, 70, 0.34);
  border-color: rgba(255, 120, 120, 0.6);
}
.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.lock-screen[hidden], .app[hidden] { display: none; }
.lock-panel {
  width: min(100%, 430px);
  padding: 18px;
  border-radius: 10px;
  background: rgba(10, 12, 18, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.lock-title { font-size: 20px; font-weight: 750; margin-bottom: 4px; }
.lock-subtitle, .note {
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.78;
}
.note { min-height: 18px; margin-top: 10px; }
.lock-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.72;
  margin: 14px 0 6px;
}
.field {
  width: 100%;
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  outline: none;
  padding: 9px 10px;
  font-size: 13px;
}
.field:focus { border-color: rgba(120, 160, 255, 0.65); }
.full { width: 100%; margin-top: 12px; }
.code-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
}
.code-input {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 5px;
}
.error {
  min-height: 18px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #ffd1d1;
}
.app {
  width: min(760px, calc(100vw - 24px));
  height: min(760px, calc(100vh - 24px));
  margin: 12px auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 18, 0.22);
  box-shadow: 0 10px 42px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.title { font-size: 13px; font-weight: 700; }
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  opacity: 0.8;
}
.sep { opacity: 0.45; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #50d266;
  box-shadow: 0 0 7px rgba(80, 210, 102, 0.7);
}
.dot.off { background: #777; box-shadow: none; }
.banner {
  display: none;
  margin: 8px 14px 0;
  padding: 8px 10px;
  font-size: 11px;
  border-radius: 6px;
  background: rgba(255, 90, 90, 0.22);
  border: 1px solid rgba(255, 120, 120, 0.5);
}
.banner.show { display: block; }
.banner.info {
  background: rgba(64, 122, 255, 0.18);
  border-color: rgba(120, 160, 255, 0.5);
}
.chat-wrap { position: relative; flex: 1; min-height: 0; }
.chat {
  height: 100%;
  overflow-y: auto;
  padding: 12px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  user-select: text;
  scroll-behavior: smooth;
}
.bubble {
  max-width: 90%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  word-wrap: break-word;
}
.bubble.system {
  align-self: center;
  max-width: 96%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 10.5px;
  opacity: 0.78;
  padding: 5px 10px;
  border-radius: 999px;
}
.bubble.heard {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  font-style: italic;
  opacity: 0.85;
}
.bubble.ai {
  align-self: flex-start;
  background: rgba(64, 122, 255, 0.18);
  border: 1px solid rgba(120, 160, 255, 0.35);
}
.bubble.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.bubble.thumb-bubble {
  align-self: flex-end;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.bubble.thumb-bubble img {
  display: block;
  max-width: 280px;
  border-radius: 6px;
}
.bubble pre {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11px;
  white-space: pre;
}
.bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 4px;
  border-radius: 3px;
}
.jump-latest {
  position: absolute;
  right: 14px;
  bottom: 10px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 650;
  background: rgba(64, 122, 255, 0.58);
  border-color: rgba(120, 160, 255, 0.7);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.jump-latest[hidden] { display: none; }
.actionbar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px 0;
}
.spacer { flex: 1; }
.composer {
  display: flex;
  gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.composer input {
  flex: 1;
  color: #f5f5f7;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 12.5px;
  outline: none;
}
.composer input:focus { border-color: rgba(120, 160, 255, 0.55); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }
