:root {
  color-scheme: dark;
  --green: #14352b;
  --green-2: #1c4a3c;
  --ink: #f7f4ef;
  --muted: rgba(247, 244, 239, .72);
  --orange: #F36B21;
  --charcoal: #1a1d1c;
  --line: rgba(255, 255, 255, .14);
  --glass: rgba(255, 255, 255, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Vazirmatn, sans-serif;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(243, 107, 33, .18), transparent 50%),
    var(--green);
  color: var(--ink);
}
h1, h2, .brand { font-family: "Space Grotesk", Vazirmatn, sans-serif; }
h1 { margin: 0; font-size: 32px; letter-spacing: .04em; }
h2 { margin: 0 0 12px; font-size: 20px; }
.brand { margin: 0; color: var(--orange); letter-spacing: .18em; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.top, .tabs, main { padding-inline: 20px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: end; padding-top: 22px; }
.login { display: flex; gap: 8px; align-items: end; }
label { display: block; font-size: 13px; margin-bottom: 6px; }
input, textarea, select, button { font: inherit; }
input, textarea, select {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .18);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
}
input[type="radio"], input[type="range"], input[type="file"] { padding: 0; background: transparent; }
button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--orange);
  color: #1b120c;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: not-allowed; background: #6d645d; color: var(--ink); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.tabs button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.tabs button.active { background: var(--orange); color: #1b120c; }
main { display: grid; gap: 16px; padding-bottom: 120px; }
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px);
}
.panel { padding: 16px; }
.stack { display: grid; gap: 10px; }
.card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .2);
}
.avatar {
  position: fixed;
  z-index: 5;
  inset-inline-end: 18px;
  bottom: 18px;
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}
.avatar-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0A4635;
  border: 1px solid rgba(255, 255, 255, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38);
  overflow: hidden;
}
.avatar::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: transparent;
  pointer-events: none;
}
.avatar[data-state="thinking"]::after {
  border-top-color: #F36B21;
  animation: spin 2.8s linear infinite;
}
.avatar:hover { transform: translateY(-1px); }
.avatar-face { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; border-radius: 50%; }
.avatar-face svg, .avatar-face img, .avatar-preview svg, .avatar-preview img { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.wordmark {
  font-family: "Space Grotesk", Vazirmatn, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -.03em;
  line-height: 1;
}
.wordmark .c { color: #fff; }
.wordmark .ai { color: #F36B21; margin-inline-start: .28em; }
.avatar-dot {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #F36B21;
  box-shadow: 0 0 0 2px #0A4635;
  opacity: 0;
}
.avatar[data-state="speaking"] .avatar-dot,
.avatar[data-state="success"] .avatar-dot { opacity: 1; }
.choices { border: 0; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.choices label { display: flex; gap: 8px; align-items: center; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.thumb, .avatar-preview {
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  background: #0A4635;
  border: 1px solid rgba(255, 255, 255, .42);
  overflow: hidden;
}
.thumb.selected { outline: 2px solid #F36B21; }
.thumb svg { width: 100%; height: 100%; display: block; }
.avatar-preview { display: grid; place-items: center; margin: 12px 0; }
.crop-controls { display: grid; gap: 8px; max-width: 280px; }
.crop-controls input { width: 100%; }
[hidden] { display: none !important; }
.chat {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 92px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.chat header { display: flex; gap: 8px; align-items: center; }
.chat header h2 { flex: 1; }
.log { display: flex; flex-direction: column; gap: 8px; min-height: 140px; }
.bubble { padding: 10px 12px; border-radius: 16px; white-space: pre-wrap; }
.manager { align-self: flex-start; background: rgba(243, 107, 33, .18); }
.colin { background: rgba(255, 255, 255, .06); }
.toast { min-height: 1.2em; padding-inline: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 800px) {
  .top, .login { display: grid; }
  .avatar, .avatar-ring, .thumb, .avatar-preview { width: 54px; height: 54px; }
  .wordmark { font-size: 11px; }
  .chat { inset-inline: 12px; width: auto; bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .glass { backdrop-filter: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
