:root {
  --bg: #090b10;
  --panel: #121622;
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef2ff;
  --muted: #8b95b0;
  --accent: #f97316;
  --free: #22c55e;
  --paid: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #11192d 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 12px);
  gap: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 15px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
}
.dot.online { background: var(--free); box-shadow: 0 0 8px var(--free); }
.dot.active { background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tier-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.tier-badge.free { color: var(--free); border-color: rgba(34, 197, 94, 0.35); }
.tier-badge.paid { color: var(--paid); border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.12); }

.voice-select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}

.alert-banner {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.alert-banner.paid {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}
.hidden { display: none; }

.stage {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0 4px;
  gap: 10px;
}

.orb {
  position: relative;
  z-index: 2;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.wave-canvas {
  position: absolute;
  left: 50%;
  top: 96px;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 720px;
  height: 220px;
  z-index: 1;
  pointer-events: none;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #f97316, #fb923c, #0ea5e9, #f97316);
  opacity: 0.45;
  filter: blur(8px);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.orb-core {
  position: relative;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #1e293b, #0c101b);
  border: 1.5px solid rgba(249, 115, 22, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 12px;
  text-align: center;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

.hank-img {
  width: 122px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(234, 88, 12, 0.35));
}

.orb.listening .orb-ring {
  opacity: 0.9;
  animation: spin 4s linear infinite;
}
.orb.speaking .orb-ring {
  opacity: 1;
  transform: scale(1.09);
  animation: spin 2s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-text {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  gap: 8px;
}

.chip {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

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

.msg {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 88%;
  word-wrap: break-word;
}
.msg.user {
  align-self: flex-end;
  background: #1d3557;
}
.msg.assistant {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
}
.msg.system {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.msg.proactive {
  align-self: stretch;
  max-width: 100%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.composer {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.composer input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.composer button {
  background: var(--accent);
  color: #06121f;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

.pin-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 11, 16, 0.94);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.pin-gate.hidden { display: none; }
.pin-card {
  width: 100%;
  max-width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pin-logo { width: 96px; height: auto; }
.pin-card h2 { margin: 0; font-size: 17px; }
.pin-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.2em;
}
.pin-card button {
  width: 100%;
  background: var(--accent);
  color: #090b10;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.pin-error { margin: 0; font-size: 13px; color: var(--danger); min-height: 18px; }
