/* RANI AI — phone web app styles. Purple neon, RANI-style orb. No build step. */
:root {
  --bg: #0d0716;
  --surface: #1a1029;
  --surface-2: #241638;
  --text: #f3efff;
  --muted: #a99cc4;
  --accent: #a855f7;
  --accent-2: #22d3ee;
  --accent-3: #22c55e;
  --border: #3b2a5e;
  --danger: #ef4444;
  --radius: 16px;
}
body[data-theme="light"] {
  --bg: #f6f2ff;
  --surface: #ffffff;
  --surface-2: #efe7ff;
  --text: #1c1030;
  --muted: #6b5b8a;
  --border: #d9cdf0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
}
#app { max-width: 560px; margin: 0 auto; padding: 12px 14px 40px; }
h1 { font-size: 1.35rem; margin: 0; letter-spacing: .04em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand p { margin: 2px 0 0; font-size: .82rem; color: var(--muted); }
.brand-orb {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; color: #fff;
  background: radial-gradient(circle at 35% 30%, #e9d5ff, #a855f7 45%, #6d28d9 80%);
  box-shadow: 0 0 22px rgba(168, 85, 247, .55);
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.chip {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 12px; font-size: .85rem; cursor: pointer;
}
.icon-btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 50%; width: 38px; height: 38px; font-size: 1rem; cursor: pointer;
}

/* Orb */
.stage { text-align: center; }
.orb-wrap { padding: 10px 0 4px; }
.orb {
  position: relative; width: 168px; height: 168px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3e8ff, #a855f7 42%, #4c1d95 78%, #2e1065);
  box-shadow: 0 0 44px rgba(168, 85, 247, .6), inset 0 0 34px rgba(255, 255, 255, .18);
  cursor: pointer; animation: breathe 4s ease-in-out infinite;
}
.orb-core {
  position: absolute; inset: 34%; border-radius: 50%;
  background: radial-gradient(circle, #fff, #e9d5ff 60%, transparent);
  opacity: .9;
}
.orb-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, .5); animation: spin 9s linear infinite;
}
.orb-ring.r2 { inset: -20px; border-color: rgba(34, 211, 238, .35); animation-duration: 14s; animation-direction: reverse; }
.orb.listening { animation: breathe 1.1s ease-in-out infinite; box-shadow: 0 0 64px rgba(34, 211, 238, .8), inset 0 0 34px rgba(255,255,255,.25); }
.orb.speaking .orb-core { animation: pulse 0.7s ease-in-out infinite alternate; }
@keyframes breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.25); } }
#orbHint { color: var(--muted); margin: 12px 0 10px; font-size: .9rem; }
.live-row { display: flex; gap: 10px; justify-content: center; }
.pill {
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; border: none;
  border-radius: 999px; padding: 11px 20px; font-size: .95rem; font-weight: 600; cursor: pointer;
}
.pill.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.pill:disabled { opacity: .45; cursor: default; }
.pill.wide { width: 100%; margin-top: 8px; }

/* Chat */
.chat { margin-top: 18px; text-align: left; }
.messages {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  min-height: 180px; max-height: 46vh; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; line-height: 1.45; font-size: .95rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #7c3aed; color: #fff; border-bottom-right-radius: 4px; }
.msg.rani { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: .82rem; text-align: center; max-width: 100%; }
.composer { display: flex; gap: 8px; margin-top: 10px; }
.composer input, .vision-actions input, .field input, .field select, .builder-panel textarea {
  flex: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 12px; font-size: .95rem; font-family: inherit; width: 100%;
}
.composer button {
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; border: none;
  border-radius: 12px; width: 48px; font-size: 1.1rem; cursor: pointer;
}
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.quick {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 11px; font-size: .82rem; cursor: pointer;
}

/* Panels */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-top: 16px;
}
.vision-btns, .builder-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#visionVideo { width: 100%; border-radius: 12px; margin-top: 12px; background: #000; max-height: 320px; }
.vision-actions { display: flex; gap: 8px; margin-top: 10px; }
.builder-panel textarea { resize: vertical; margin-bottom: 10px; }
#sitePreview { width: 100%; height: 380px; border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; background: #fff; }
.foot { text-align: center; margin-top: 22px; font-size: .8rem; }

/* Sheets (settings / auth) */
.sheet {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.sheet-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px; max-height: 88dvh; overflow-y: auto; padding: 18px;
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 5px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; font-size: .92rem; }
@media (min-width: 600px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 20px; }
}
