:root {
  --bg: #070b14;
  --bg-elev: #0c1322;
  --card: rgba(18, 28, 48, 0.88);
  --card-solid: #121c30;
  --text: #e8f1ff;
  --muted: #8aa0bf;
  --line: rgba(120, 170, 255, 0.14);
  --line-strong: rgba(100, 180, 255, 0.28);
  --accent: #3ba0ff;
  --accent-2: #59c4ff;
  --accent-soft: rgba(59, 160, 255, 0.16);
  --accent-glow: rgba(59, 160, 255, 0.38);
  --cyan: #45e0ff;
  --ok: #3dd68c;
  --warn: #f5b942;
  --danger: #ff5a6a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0, 8, 24, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI", system-ui, -apple-system, "Roboto", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #070b14 !important;
  color: #e8f1ff !important;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(59, 160, 255, 0.22), transparent 58%),
    radial-gradient(700px 360px at 100% 0%, rgba(69, 224, 255, 0.1), transparent 52%),
    radial-gradient(600px 500px at 50% 110%, rgba(30, 80, 160, 0.18), transparent 60%),
    linear-gradient(180deg, #070b14 0%, #0a1020 100%);
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
code {
  font-size: 0.86em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(59, 160, 255, 0.12);
  color: var(--accent-2);
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 14px calc(28px + var(--safe-b));
}

.top { margin-bottom: 12px; animation: fadeDown 0.2s var(--ease) both; }
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.brand {
  font-size: 28px;
  font-weight: 780;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #fff 20%, var(--accent-2) 55%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 9px;
}
.sub { color: var(--muted); margin-top: 4px; font-size: 13px; }

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  margin: 0 -2px 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative;
  border: 1px solid var(--line);
  background: rgba(14, 22, 40, 0.72);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  font-weight: 650;
  font-size: 13px;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    color 0.25s var(--ease),
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.2s var(--ease);
}
.tab-emoji {
  width: 19px;
  height: 19px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}
.ui-emoji {
  width: 17px;
  height: 17px;
  object-fit: contain;
  vertical-align: -3px;
  display: inline-block;
  margin-right: 4px;
  flex-shrink: 0;
}
.tabs button span { position: relative; z-index: 1; }
.tabs button:active { transform: scale(0.96); }
.tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  border-color: transparent;
  box-shadow: 0 6px 22px var(--accent-glow);
}

.view {
  min-height: 48vh;
  animation: viewIn 0.15s var(--ease) both;
}
.view.is-leaving {
  animation: viewOut 0.1s ease both;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  margin-bottom: 12px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardIn 0.2s var(--ease) both;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120, 190, 255, 0.45), transparent);
  opacity: 0.7;
  pointer-events: none;
}
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }

.card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.card p, .muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}
.hint {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  margin: 0 0 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.hint-dot {
  width: 8px; height: 8px; margin-top: 5px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.72);
  border: 1px solid var(--line);
}
.seg button {
  flex: 1;
  border: 0;
  border-radius: 11px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  transition: background 0.22s var(--ease), color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.seg button.on {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stat {
  background: rgba(7, 12, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.stat:active { transform: scale(0.98); }
.stat b {
  display: block;
  font-size: 22px;
  margin-top: 2px;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { color: var(--muted); font-size: 12px; }

.map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.map-item {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.55);
  border-radius: 14px;
  padding: 12px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.2s var(--ease);
}
.map-item:active { transform: scale(0.97); }
.map-item:hover, .map-item:focus-visible {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  outline: none;
}
.map-item strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}
.map-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.field-grid label.field { margin-top: 0; }
.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.55);
}
.toggle b { font-size: 14px; }
.toggle span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
label.field {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 8px 0 0;
}
input, textarea, select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(7, 12, 24, 0.72);
  color: var(--text);
  padding: 12px 13px;
  margin: 6px 0 0;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: rgba(10, 18, 34, 0.9);
}
textarea { min-height: 118px; resize: vertical; }
input[type="file"] {
  padding: 10px;
  background: rgba(59, 160, 255, 0.06);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  color: #fff;
  padding: 12px 14px;
  font-weight: 720;
  font-size: 14px;
  width: 100%;
  margin-top: 8px;
  box-shadow: 0 8px 22px rgba(42, 127, 214, 0.28);
  transition: transform 0.18s var(--ease), filter 0.18s var(--ease), opacity 0.18s;
}
.btn:active { transform: scale(0.98); filter: brightness(0.96); }
.btn:disabled { opacity: 0.55; pointer-events: none; }
.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn.danger {
  background: linear-gradient(135deg, #ff5a6a, #d9364a);
  box-shadow: 0 8px 22px rgba(255, 90, 106, 0.25);
}
.btn.ghost {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  box-shadow: none;
}
.btn.sm { padding: 8px 10px; font-size: 12px; margin-top: 0; width: auto; }
.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }

.list-item {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  animation: cardIn 0.18s var(--ease) both;
}
.list-item:first-child { border-top: 0; padding-top: 2px; }
.list-item .title { font-weight: 650; font-size: 14px; }
.list-item .meta { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.emoji-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  transition:
    transform 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}
.emoji-cell:active { transform: scale(0.94); }
.emoji-cell.selected,
.emoji-cell:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(59, 160, 255, 0.2), 0 8px 24px var(--accent-glow);
  outline: none;
}
.emoji-cell img, .emoji-cell video {
  width: 68%;
  height: 68%;
  object-fit: contain;
  pointer-events: none;
}
.emoji-cell .alt-fallback {
  font-size: 28px;
  line-height: 1;
}
.emoji-cell .pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(120, 180, 255, 0.12) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 0.8s linear infinite;
}

.emoji-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.emoji-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.emoji-preview-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 28, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.emoji-preview-lg img, .emoji-preview-lg video {
  width: 78%; height: 78%; object-fit: contain;
}
.emoji-preview-lg .alt-fallback { font-size: 34px; }
.emoji-meta h3 { margin: 0 0 4px; font-size: 15px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font-size: 11px;
  font-weight: 650;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
}

.img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.img-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.65);
}
.img-card .thumb {
  position: relative;
  aspect-ratio: 16/11;
  background: #0a1220;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-card .body { padding: 8px 10px 10px; }
.img-card .title { font-size: 12px; font-weight: 650; }
.img-card .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill.warn { color: var(--warn); background: rgba(245, 185, 66, 0.12); }
.status-pill.ok { color: var(--ok); background: rgba(61, 214, 140, 0.12); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%) translateY(12px);
  background: rgba(10, 18, 34, 0.94);
  color: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  z-index: 40;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  max-width: min(92vw, 420px);
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.sheet[hidden] { display: none !important; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.62);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease both;
}
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: min(78vh, 620px);
  overflow: auto;
  background: linear-gradient(180deg, #121c30, #0c1322);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  padding: 8px 14px calc(18px + var(--safe-b));
  box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.45);
  animation: sheetUp 0.32s var(--ease) both;
}
.sheet-handle {
  width: 42px; height: 4px;
  border-radius: 999px;
  background: rgba(140, 180, 230, 0.35);
  margin: 4px auto 12px;
}
.picker-title { margin: 0 0 4px; font-size: 17px; }
.picker-sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.skeleton {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(110deg, #101828 25%, #182438 40%, #101828 55%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
  margin-bottom: 12px;
}

.empty {
  text-align: center;
  padding: 18px 10px;
  color: var(--muted);
  font-size: 13px;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes viewOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-4px); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 520px) {
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .map-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* === Modernized Studio Styles === */

/* Header / Emoji Alignment (Fix Image 0) */
.emoji-detail-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 4px 0;
}
.emoji-preview-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 14, 28, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 64px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.emoji-preview-lg img, .emoji-preview-lg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.emoji-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.emoji-meta h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.emoji-meta .meta { margin: 0; }
.emoji-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(59, 160, 255, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: inline-block;
  letter-spacing: 0.3px;
  width: fit-content;
}

/* Autopilot Switch (Single Clean Button) */
.autopilot-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(8, 14, 28, 0.65);
  border: 1px solid var(--line);
  margin-top: 10px;
}
.autopilot-info h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.autopilot-info p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.autopilot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}
.autopilot-toggle.is-on {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
}
.autopilot-toggle.is-off {
  background: #374151 !important;
  color: #9ca3af !important;
  border-color: #4b5563 !important;
  box-shadow: none;
}
.autopilot-toggle .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transition: all 0.25s var(--ease);
}
.autopilot-toggle.is-on .dot {
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}
.autopilot-toggle.is-off .dot {
  background: #9ca3af;
}

/* Reference Dropzone (Fix Image 1) */
.dropzone {
  border: 2px dashed rgba(59, 130, 246, 0.35);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(8, 14, 28, 0.45);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  position: relative;
  margin-top: 10px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}
.dropzone-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}
.dropzone-icon {
  font-size: 34px;
  margin-bottom: 8px;
}
.dropzone-prompt strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.dropzone-prompt span {
  font-size: 12px;
  color: var(--muted);
}
.dropzone-preview {
  position: relative;
  display: inline-block;
  max-width: 100%;
  z-index: 3;
}
.dropzone-preview img {
  max-height: 180px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.dropzone-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Telegram Post Bubble Preview (Fix Image 2) */
.tg-bubble {
  background: #182533;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 14px 16px 10px;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  margin: 12px 0 14px;
}
.tg-bubble-photo {
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #0e1621;
}
.tg-bubble-photo img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}
.tg-bubble-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.35;
}
.tg-bubble-text {
  font-size: 14px;
  line-height: 1.48;
  color: #e4ecf2;
  word-break: break-word;
  white-space: pre-wrap;
}
.tg-bubble-text a {
  color: #64b5f6;
  text-decoration: underline;
}
.tg-bubble-text .hashtag {
  color: #5288c1;
  font-weight: 500;
}
.tg-bubble-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 11px;
  color: #728b9f;
}
.tg-bubble-footer .check {
  color: #4da6ff;
  font-weight: bold;
}
.editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.editor-tabs button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.6);
  color: var(--muted);
  cursor: pointer;
}
.editor-tabs button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
}

/* Evaluation Badge */
.eval-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: rgba(14, 22, 38, 0.7);
  color: var(--text);
  transition: all 0.2s var(--ease);
}
.eval-badge.eval-good {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}
.eval-badge.eval-bad {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.eval-badge.eval-loading {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  animation: pulse 1.5s infinite;
}
.eval-badge.eval-neutral {
  background: rgba(30, 41, 59, 0.6);
  border-color: var(--line);
  color: var(--muted);
}
.eval-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Lesson card */
.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
}
.lesson-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lesson-cat {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--muted);
  text-transform: uppercase;
}
.lesson-photo-thumb {
  margin: 6px 0;
  max-width: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.lesson-photo-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.lesson-do {
  font-size: 13px;
  line-height: 1.4;
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #10b981;
}
.lesson-dont {
  font-size: 13px;
  line-height: 1.4;
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid #ef4444;
}
.lesson-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
  padding-left: 6px;
}

/* Filter pills */
.emoji-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin: 12px 0;
  -webkit-overflow-scrolling: touch;
}
.emoji-filter-pill {
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.emoji-filter-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.3);
}
.emoji-filter-pill.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Emoji list */
.emoji-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.emoji-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(14, 22, 38, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all 0.2s var(--ease);
}
.emoji-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(20, 32, 54, 0.85);
}
.emoji-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.emoji-card-icon img, .emoji-card-icon video {
  width: 85%;
  height: 85%;
  object-fit: contain;
}
.emoji-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
}
.emoji-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.emoji-card-id {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  color: #60a5fa;
  letter-spacing: 0.2px;
}
.emoji-card-del {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.18s var(--ease);
  flex-shrink: 0;
}
.emoji-card-del:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Inline emoji inside telegram bubble preview */
.inline-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  vertical-align: -4px;
  margin: 0 2px;
}
.inline-emoji img, .inline-emoji video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== Improved Lessons Design ===== */
.lesson-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.form-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.form-row .flex-1 { flex: 1; }
.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.form-actions {
  display: flex;
  gap: 8px;
}
.form-actions .btn { flex: 1; }
.btn.full { width: 100%; }

.eval-wrap { margin: 4px 0; }

.ref-dropzone.modern {
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(14, 22, 40, 0.45);
  transition: border-color 0.15s, background 0.15s;
}
.ref-dropzone.modern:hover {
  border-color: var(--accent);
  background: rgba(59, 160, 255, 0.06);
}
.ref-dropzone-empty {
  padding: 22px 16px;
  text-align: center;
}
.ref-dropzone-icon { font-size: 28px; margin-bottom: 6px; }
.ref-dropzone-text { font-weight: 600; font-size: 14px; }
.ref-dropzone-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.lesson-card {
  background: rgba(12, 18, 32, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  gap: 10px;
}
.lesson-header {
  margin-bottom: 2px;
}
.status-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
}
.lesson-do, .lesson-dont {
  margin: 2px 0;
}

.emoji-fallback {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   CALENDAR & SCHEDULE DATE PICKER STYLES
   ========================================================================== */
.schedule-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.schedule-mode-toggle button {
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 22, 40, 0.5);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.schedule-mode-toggle button.on {
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.weekdays-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}
.weekday-chip {
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 22, 40, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.weekday-chip:hover {
  border-color: var(--accent);
}
.weekday-chip.on {
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px var(--accent-glow);
}

.calendar-card {
  background: rgba(10, 16, 30, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.calendar-nav .month-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}
.calendar-nav button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.calendar-grid .day-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0;
}
.calendar-grid .cal-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.calendar-grid .cal-cell:hover {
  border-color: rgba(59, 160, 255, 0.5);
  background: rgba(59, 160, 255, 0.08);
}
.calendar-grid .cal-cell.today {
  border-color: #3dd68c;
}
.calendar-grid .cal-cell.today::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3dd68c;
}
.calendar-grid .cal-cell.active {
  background: linear-gradient(135deg, var(--accent), #2a7fd6);
  color: #fff;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.calendar-grid .cal-cell.empty {
  visibility: hidden;
  border: 0;
  pointer-events: none;
}

.calendar-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.preset-btn {
  flex: 1;
  min-width: 70px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.preset-btn:hover {
  color: #fff;
  border-color: var(--accent);
}

.next-slot-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(59, 160, 255, 0.12);
  border: 1px solid rgba(59, 160, 255, 0.3);
  margin-bottom: 14px;
}
.next-slot-banner .icon {
  font-size: 20px;
}
.next-slot-banner .text {
  font-size: 13px;
  line-height: 1.4;
  color: #e2e8f0;
}
.next-slot-banner strong {
  color: #fff;
}

/* ==========================================================================
   Ultra-Modern Premium Emoji Dashboard & UI Enhancements
   ========================================================================== */
.emoji-dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.emoji-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.emoji-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.emoji-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.emoji-stat-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.emoji-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.emoji-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.emoji-search-box {
  flex: 1;
  min-width: 180px;
  position: relative;
}
.emoji-search-input {
  width: 100%;
  background: rgba(14, 22, 40, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 34px;
  font-size: 13px;
  color: #fff;
  transition: all 0.2s ease;
}
.emoji-search-input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(69, 224, 255, 0.25);
}
.emoji-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.emoji-actions-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-modern-action {
  background: linear-gradient(135deg, rgba(59, 160, 255, 0.15), rgba(69, 224, 255, 0.08));
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease);
}
.btn-modern-action:hover {
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #050b18;
  box-shadow: 0 4px 18px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-modern-action:active {
  transform: scale(0.96);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.emoji-card {
  position: relative;
  background: rgba(18, 28, 48, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  user-select: none;
}
.emoji-card:hover {
  background: rgba(26, 40, 68, 0.85);
  border-color: rgba(120, 190, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 15, 40, 0.45);
}
.emoji-card.is-selected {
  background: rgba(59, 160, 255, 0.18);
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(69, 224, 255, 0.35);
}
.emoji-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: rgba(8, 14, 28, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.15s ease;
}
.emoji-card.is-selected .emoji-card-check {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #040914;
  font-weight: 800;
}

.emoji-preview-box {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: radial-gradient(circle at center, rgba(59, 160, 255, 0.2), transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  margin-bottom: 8px;
}
.emoji-preview-box img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
  transition: transform 0.2s var(--ease);
}
.emoji-card:hover .emoji-preview-box img {
  transform: scale(1.15);
}
.emoji-preview-box .alt-icon {
  font-size: 32px;
}

.emoji-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.emoji-card-id {
  font-size: 10px;
  font-family: monospace;
  color: var(--muted);
  margin-top: 2px;
  cursor: copy;
}
.emoji-card-id:hover {
  color: var(--cyan);
}
.emoji-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 6px;
  max-height: 36px;
  overflow: hidden;
}
.emoji-tag-pill {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.emoji-card-stats {
  margin-top: 8px;
  font-size: 10px;
  color: var(--cyan);
  font-weight: 600;
}
.emoji-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  width: 100%;
}
.btn-card-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-card-action.danger:hover {
  background: rgba(255, 71, 87, 0.25);
  border-color: var(--danger);
  color: #ff6b81;
}

/* Floating Bulk Action Bar */
.floating-bulk-bar {
  position: fixed;
  bottom: calc(20px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(14, 22, 40, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid var(--cyan);
  border-radius: 999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(69, 224, 255, 0.25);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  pointer-events: none;
  opacity: 0;
}
.floating-bulk-bar.is-visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  opacity: 1;
}
.bulk-count-badge {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.btn-bulk-delete {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(255, 71, 87, 0.4);
  transition: all 0.15s ease;
}
.btn-bulk-delete:active {
  transform: scale(0.95);
}
.btn-bulk-cancel {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

/* Autopilot Mode Cards */
.autopilot-mode-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.6);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.autopilot-mode-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
}
.autopilot-mode-card.active {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.15);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   TELETHON PREMIUM AUTH MODAL & QR CODE STYLES (v18.0)
   ========================================================================== */
.auth-modal-wrap {
  padding: 6px 4px 16px;
}
.auth-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 160, 255, 0.25), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(89, 196, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(59, 160, 255, 0.25);
  flex-shrink: 0;
}
.btn-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-sheet-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: scale(1.05);
}
.auth-segmented-control {
  display: flex;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 6px;
}
.auth-segmented-btn {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  transition: all 0.22s var(--ease);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-segmented-btn:hover {
  color: #ffffff;
}
.auth-segmented-btn.active {
  background: linear-gradient(135deg, #2b7ce6, #1d62c7);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(43, 124, 230, 0.45);
}
.qr-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-card {
  background: linear-gradient(180deg, rgba(16, 26, 46, 0.95), rgba(11, 18, 33, 0.98));
  border: 1px solid rgba(89, 196, 255, 0.3);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 24px rgba(59, 160, 255, 0.08);
}
.qr-img-wrapper {
  position: relative;
  background: #ffffff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.qr-code-img {
  display: block;
  width: 210px;
  height: 210px;
  border-radius: 6px;
}
.qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #3ba0ff, #59c4ff, transparent);
  box-shadow: 0 0 12px #3ba0ff;
  animation: qrScanMove 2.4s ease-in-out infinite;
}
@keyframes qrScanMove {
  0% { top: 6%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 94%; opacity: 0; }
}
.qr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 14px;
  background: rgba(13, 22, 40, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.pulse-dot.green {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.qr-instructions {
  width: 100%;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.qr-inst-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.35;
}
.qr-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(59, 160, 255, 0.2);
  border: 1px solid rgba(59, 160, 255, 0.4);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-notice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(59, 160, 255, 0.08);
  border: 1px solid rgba(59, 160, 255, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 12px;
}
.auth-input-phone {
  width: 100%;
  padding: 14px;
  background: #0a1120;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}
.auth-input-phone:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-input-code {
  width: 220px;
  margin: 0 auto;
  padding: 14px;
  background: #0a1120;
  border: 2px solid var(--accent);
  border-radius: 14px;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
  box-shadow: 0 0 20px var(--accent-soft);
}
.auth-success-circle {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #3dd68c, #1fa565);
  box-shadow: 0 0 24px rgba(61, 214, 140, 0.5);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popSuccess 0.4s var(--ease) both;
}
@keyframes popSuccess {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.qr-loading-box {
  padding: 40px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 160, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}





/* AI Assistant Chat Styles */
.chat-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.chat-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: var(--accent-2);
}
.chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: rgba(18, 26, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}
.chat-sender {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chat-msg.user .chat-sender {
  color: #93c5fd;
  text-align: right;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
