:root {
  --gold:        #c9a96a;
  --gold-hi:     #dec188;
  --gold-strong: rgba(201, 169, 106, 0.85);
  --gold-soft:   rgba(201, 169, 106, 0.22);
  --gold-faint:  rgba(201, 169, 106, 0.08);
  --cream:       rgba(245, 230, 200, 0.92);
  --cream-soft:  rgba(245, 230, 200, 0.7);
  --warm-dark-1: rgba(28, 24, 20, 0.78);
  --warm-dark-2: rgba(22, 18, 14, 0.82);
  --warm-dark-3: rgba(18, 15, 12, 0.94);
  --bezier:      cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] { display: none !important; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

#video-intro,
#video-loop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

#video-loop {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#video-loop.active {
  opacity: 1;
}

.blur-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 64%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
  mask-image: linear-gradient(to right, black 52%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 52%, transparent 100%);
}

.blur-overlay.visible {
  opacity: 1;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.25), transparent);
}

body.landing-mode #video-intro,
body.landing-mode #video-loop,
body.landing-mode .blur-overlay,
body.landing-mode .ui-container {
  opacity: 0;
  pointer-events: none;
}

.landing-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.2) 48%, rgba(0, 0, 0, 0.74) 100%),
    radial-gradient(circle at 50% 24%, rgba(232, 188, 113, 0.18), transparent 32%),
    url('assets/landing/askzakir-stage-hero.png') center / cover no-repeat;
  color: var(--cream);
}

.landing-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.62), transparent 24%, transparent 76%, rgba(0, 0, 0, 0.62)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 38%, rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.landing-screen::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.58));
  pointer-events: none;
}

.landing-brand {
  position: absolute;
  top: clamp(10px, 2vw, 24px);
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(36px, 5.4vw, 76px);
  font-weight: 600;
  color: rgba(245, 230, 200, 0.94);
  text-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.landing-question {
  position: absolute;
  z-index: 2;
  bottom: clamp(176px, 24vh, 260px);
  left: 50%;
  right: auto;
  width: min(760px, calc(100vw - 96px));
  min-height: 0;
  padding: 24px 32px 22px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(15, 13, 11, 0.78);
  border: 1px solid rgba(245, 230, 200, 0.18);
  border-left: 4px solid rgba(201, 169, 106, 0.78);
  border-radius: 2px;
  color: var(--cream);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.55s ease, transform 0.55s var(--bezier);
}

.landing-question.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.landing-question-left {
  left: 50%;
  right: auto;
}

.landing-question-right {
  left: 50%;
  right: auto;
}

.landing-question::before {
  content: 'Вопрос';
  position: static;
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 169, 106, 0.92);
}

.landing-question::after {
  content: none;
}

.landing-question-left::after {
  transform: none;
}

.landing-question-right::after {
  transform: none;
}

.landing-question-text {
  position: relative;
  padding: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(28px, 2.4vw, 38px);
  font-weight: 600;
  line-height: 1.08;
  color: rgba(245, 230, 200, 0.96);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.34);
}

.landing-question-text::before {
  content: none;
}

.landing-question-action {
  align-self: flex-start;
  border: none;
  border-bottom: 1px solid rgba(201, 169, 106, 0.62);
  border-radius: 0;
  padding: 0 0 3px;
  background: transparent;
  background-image: linear-gradient(110deg,
    rgba(201, 169, 106, 0.95) 0%,
    rgba(201, 169, 106, 0.95) 38%,
    rgba(245, 230, 200, 0.98) 48%,
    rgba(255, 248, 225, 1) 50%,
    rgba(245, 230, 200, 0.98) 52%,
    rgba(201, 169, 106, 0.95) 62%,
    rgba(201, 169, 106, 0.95) 100%
  );
  background-size: 420% 100%;
  background-position: 0% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: none;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
  animation: landing-action-shine 1.8s ease-in-out infinite;
}

.landing-question-action:hover {
  border-color: rgba(245, 230, 200, 0.72);
}

@keyframes landing-action-shine {
  0%   { background-position: 100% 0; }
  52%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

.ui-container {
  position: fixed;
  top: 32px;
  bottom: 32px;
  left: 32px;
  z-index: 1;
  width: min(500px, calc(100vw - 64px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}

.ui-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.chat-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding: 4px 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 106, 0.25) transparent;
}

.chat-area::after {
  content: '';
  flex: 0 0 var(--chat-tail-space, 0px);
  pointer-events: none;
}

.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-thumb { background: rgba(201, 169, 106, 0.25); border-radius: 2px; }

.turn {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* User message — appears full, then condenses to single line */
.user-msg {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(245, 230, 200, 0.92);
  background: linear-gradient(135deg, rgba(28, 24, 20, 0.78), rgba(38, 32, 26, 0.68));
  border: 1px solid rgba(201, 169, 106, 0.22);
  border-radius: 18px;
  padding: 12px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(24px);
  max-height: 240px;
  overflow: hidden;
  white-space: pre-wrap;
  text-overflow: clip;
  word-break: break-word;
  transition:
    opacity 0.55s ease,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.user-msg.entered {
  opacity: 1;
  transform: translateY(0);
}

.user-msg.collapsed {
  max-height: 2.4em;
  padding-top: 9px;
  padding-bottom: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  color: rgba(245, 230, 200, 0.7);
}

/* Response slot — holds either ayat-card or ai-response */
.response-slot {
  position: relative;
  min-height: 0;
}

/* AI response */
.ai-response {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  color: rgba(245, 240, 230, 0.95);
  padding: 4px 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ai-response.visible {
  opacity: 1;
  transform: translateY(0);
}

.ai-response > :first-child { margin-top: 0; }
.ai-response > :last-child { margin-bottom: 0; }

.ai-response p,
.ai-response ul,
.ai-response ol,
.ai-response blockquote,
.ai-response pre,
.ai-response hr,
.ai-response h2,
.ai-response h3,
.ai-response h4 {
  margin: 0 0 14px;
}

.ai-response h2,
.ai-response h3,
.ai-response h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: rgba(245, 230, 200, 0.98);
}

.ai-response h2 { font-size: 30px; }
.ai-response h3 { font-size: 24px; }
.ai-response h4 { font-size: 20px; }

.ai-response ul,
.ai-response ol {
  padding-left: 1.35em;
}

.ai-response li + li {
  margin-top: 7px;
}

.ai-response blockquote {
  padding: 10px 16px 10px 18px;
  border-left: 2px solid rgba(201, 169, 106, 0.62);
  background: linear-gradient(135deg, rgba(32, 27, 22, 0.52), rgba(24, 20, 17, 0.36));
  color: rgba(245, 235, 215, 0.82);
}

.ai-response hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201, 169, 106, 0.46), transparent);
}

.ai-response pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid rgba(201, 169, 106, 0.14);
  background: rgba(16, 14, 12, 0.82);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ai-response code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
}

.ai-response :not(pre) > code {
  padding: 0.12em 0.42em;
  border-radius: 6px;
  background: rgba(201, 169, 106, 0.12);
  color: rgba(245, 230, 200, 0.95);
}

.ai-response a {
  color: rgba(220, 190, 128, 0.95);
  text-decoration: underline;
  text-decoration-color: rgba(220, 190, 128, 0.38);
  text-underline-offset: 3px;
}

.ai-response a:hover {
  color: rgba(245, 230, 200, 0.98);
  text-decoration-color: rgba(245, 230, 200, 0.52);
}

.ai-response strong {
  font-weight: 700;
  letter-spacing: 0.012em;
  font-synthesis: none;
  color: transparent;
  background-image: linear-gradient(110deg,
    rgba(210, 163, 58, 0.99) 0%,
    rgba(210, 163, 58, 0.99) 34%,
    rgba(247, 208, 98, 1) 47%,
    rgba(255, 244, 188, 1) 50%,
    rgba(247, 208, 98, 1) 53%,
    rgba(210, 163, 58, 0.99) 66%,
    rgba(210, 163, 58, 0.99) 100%
  );
  background-size: 340% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.35px rgba(166, 122, 32, 0.42);
  text-shadow:
    0 0 1px rgba(210, 163, 58, 0.32),
    0 0 10px rgba(210, 163, 58, 0.1);
  animation: ai-markdown-shine 4.2s ease-in-out infinite;
}

.ai-response em {
  font-style: italic;
  color: rgba(245, 232, 210, 0.92);
}

@keyframes ai-markdown-shine {
  0%   { background-position: 100% 0; }
  42%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

.ai-response .caret {
  display: inline-block;
  width: 6px;
  height: 0.95em;
  vertical-align: -2px;
  margin-left: 2px;
  background: rgba(201, 169, 106, 0.85);
  animation: caret-blink 1.05s steps(1) infinite;
}

@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* Ayat card with Islamic ornament frame */
.ayat-card {
  position: relative;
  overflow: hidden;
  padding: 26px 30px 22px;
  background: linear-gradient(180deg, rgba(22, 18, 14, 0.82), rgba(18, 15, 12, 0.78));
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #c9a96a;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  box-shadow:
    0 1px 0 rgba(201, 169, 106, 0.12) inset,
    0 0 0 1px rgba(201, 169, 106, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.4);
}

.ayat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 38%,
    rgba(245, 230, 200, 0.05) 47%,
    rgba(245, 230, 200, 0.16) 50%,
    rgba(245, 230, 200, 0.05) 53%,
    transparent 62%
  );
  transform: translateX(-110%);
  pointer-events: none;
}

.ayat-card.visible::after {
  animation: ayat-shine 3s ease-in-out 0.8s infinite;
}

@keyframes ayat-shine {
  0%   { transform: translateX(-110%); }
  40%  { transform: translateX(110%);  }
  100% { transform: translateX(110%);  }
}

.ayat-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.ayat-card.leaving {
  opacity: 0;
  transform: translateY(-4px);
}

.ayat-card .ornament {
  position: absolute;
  width: 22px;
  height: 22px;
  color: #c9a96a;
  pointer-events: none;
}
.ayat-card .ornament.tl { top: 8px; left: 8px; }
.ayat-card .ornament.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.ayat-card .ornament.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.ayat-card .ornament.br { bottom: 8px; right: 8px; transform: scale(-1, -1); }

.ayat-card .ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(201, 169, 106, 0.55);
  margin: 0 18px;
}
.ayat-card .ornament-divider::before,
.ayat-card .ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201, 169, 106, 0.35), transparent);
}
.ayat-card .ornament-divider svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.ayat-arabic {
  font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  font-size: 26px;
  line-height: 1.85;
  color: #f3e3bf;
  text-align: center;
  direction: rtl;
  margin-bottom: 14px;
  letter-spacing: 0.005em;
  text-shadow: 0 1px 12px rgba(201, 169, 106, 0.12);
}

.ayat-translation {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(245, 235, 215, 0.86);
  text-align: center;
  margin-top: 12px;
  padding: 0 6px;
}

.ayat-source {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(201, 169, 106, 0.7);
  text-align: center;
  margin-top: 14px;
}

/* Input */
.input-wrapper {
  flex: none;
  position: relative;
  background: linear-gradient(135deg, rgba(40, 40, 45, 0.85), rgba(55, 55, 60, 0.75));
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 58px 12px 22px;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.input-wrapper.busy {
  opacity: 0.55;
  border-color: rgba(201, 169, 106, 0.18);
}

.input-wrapper textarea {
  width: 100%;
  display: block;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
  color: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 0;
  margin: 0;
  min-height: 1.5em;
  max-height: 200px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.input-wrapper textarea::-webkit-scrollbar { width: 4px; }
.input-wrapper textarea::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 2px; }

.input-wrapper textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.input-wrapper textarea:disabled {
  cursor: default;
}

.input-hint {
  position: absolute;
  right: 16px;
  bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.input-wrapper.has-text .input-hint {
  opacity: 1;
}

.input-send {
  position: absolute;
  right: 10px;
  bottom: 9px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(201, 169, 106, 0.28);
  border-radius: 50%;
  background: rgba(201, 169, 106, 0.16);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.input-send:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(201, 169, 106, 0.28);
  color: var(--gold-hi);
}

.input-send:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.input-send svg {
  width: 18px;
  height: 18px;
}

#dev-panel {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

body:not(.dev-mode) #dev-panel {
  display: none;
}

#dev-panel .dev-title {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: monospace;
  margin-bottom: 4px;
}

#dev-panel label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#dev-panel input[type="range"] {
  width: 100%;
  accent-color: #888;
}

#dev-panel .dev-btn {
  margin-top: 6px;
  background: rgba(201, 169, 106, 0.12);
  border: 1px solid rgba(201, 169, 106, 0.3);
  color: #c9a96a;
  font-family: monospace;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.2s ease;
}

#dev-panel .dev-btn:hover:not(:disabled) {
  background: rgba(201, 169, 106, 0.22);
}

#dev-panel .dev-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ─── Drawer toggle button (top-left of ui-container) ────────────────── */
.drawer-toggle {
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(20, 17, 14, 0.55);
  border: 1px solid var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.4s var(--bezier);
  z-index: 2;
}

.drawer-toggle:hover {
  opacity: 1;
  background: rgba(28, 24, 20, 0.78);
  border-color: var(--gold);
}

.drawer-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.18);
}

.drawer-toggle svg {
  width: 20px;
  height: 20px;
}

/* ─── Drawer ─────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 30;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(340px, 86vw);
  height: 100vh;
  background: linear-gradient(180deg, var(--warm-dark-3), rgba(14, 12, 10, 0.96));
  border-right: 1px solid var(--gold-soft);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(-102%);
  transition: transform 0.45s var(--bezier);
  display: flex;
  flex-direction: column;
  padding: 22px 18px 18px;
  z-index: 31;
  color: var(--cream);
  box-shadow: 24px 0 60px rgba(0, 0, 0, 0.45);
}

.drawer.open {
  transform: translateX(0);
}

.drawer > .ornament {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--gold);
  pointer-events: none;
}
.drawer > .ornament.tl { top: 10px; left: 10px; }
.drawer > .ornament.tr { top: 10px; right: 10px; transform: scaleX(-1); }

.drawer-header {
  padding: 6px 8px 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--gold-faint);
}

.drawer-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-align: center;
}

.drawer-new {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 13px 16px;
  background: rgba(201, 169, 106, 0.06);
  border: 1px solid var(--gold-soft);
  border-radius: 10px;
  color: var(--cream);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.drawer-new:hover {
  background: rgba(201, 169, 106, 0.14);
  border-color: var(--gold);
  color: var(--gold-hi);
}

.drawer-new svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex: none;
}

.drawer-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 106, 0.25) transparent;
}

.drawer-list-wrap::-webkit-scrollbar { width: 4px; }
.drawer-list-wrap::-webkit-scrollbar-thumb { background: rgba(201, 169, 106, 0.25); border-radius: 2px; }

.drawer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.drawer-item {
  position: relative;
  display: block;
  padding: 12px 14px 12px 18px;
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  color: var(--cream-soft);
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.18s ease, color 0.18s ease;
}

.drawer-item:hover {
  background: rgba(201, 169, 106, 0.07);
  color: var(--cream);
}

.drawer-item.active {
  background: rgba(201, 169, 106, 0.10);
  color: var(--gold-hi);
}

.drawer-item.active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 30%;
  bottom: 30%;
  width: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.drawer-empty {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 16px;
  color: rgba(245, 230, 200, 0.35);
  text-align: center;
  padding: 24px 12px;
}

.drawer-footer {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--gold-faint);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.drawer-user-login {
  flex: 1 1 100%;
  min-width: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  color: var(--cream-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-plan {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(201, 169, 106, 0.07);
  border: 1px solid var(--gold-faint);
  border-radius: 8px;
  color: var(--cream);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.drawer-plan span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-plan span:last-child {
  flex: none;
  color: var(--gold);
}

.drawer-plan:hover {
  background: rgba(201, 169, 106, 0.12);
  border-color: var(--gold-soft);
}

.drawer-plan.depleted {
  border-color: rgba(222, 193, 136, 0.42);
  color: var(--gold-hi);
}

.drawer-logout {
  background: transparent;
  border: none;
  color: var(--gold);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 8px;
  transition: color 0.2s ease;
}

.drawer-logout:hover { color: var(--gold-hi); }

/* ─── Billing status + pricing modal ─────────────────────────────────── */
.billing-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.billing-status,
.billing-open {
  font-family: 'Cormorant Garamond', Georgia, serif;
  border: 1px solid var(--gold-faint);
  color: var(--cream-soft);
  background: rgba(18, 15, 12, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.billing-status {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  text-align: left;
  font-size: 15px;
}

.billing-status span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-open {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--gold);
  font-size: 14px;
}

.billing-status:hover,
.billing-open:hover {
  color: var(--gold-hi);
  border-color: var(--gold-soft);
  background: rgba(201, 169, 106, 0.09);
}

.billing-bar.depleted .billing-status {
  color: var(--gold-hi);
  border-color: rgba(222, 193, 136, 0.45);
}

.pricing-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.pricing-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.pricing-modal {
  position: fixed;
  z-index: 51;
  top: 50%;
  left: 50%;
  width: min(1040px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  transform: translate(-50%, -48%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  padding: 28px;
  color: var(--cream);
  background:
    linear-gradient(180deg, rgba(25, 21, 17, 0.985), rgba(15, 13, 11, 0.982));
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  box-shadow:
    0 1px 0 rgba(201, 169, 106, 0.12) inset,
    0 34px 90px rgba(0, 0, 0, 0.58);
  transition: opacity 0.35s ease, transform 0.35s var(--bezier);
}

.pricing-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.pricing-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cream-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.pricing-close:hover {
  background: rgba(201, 169, 106, 0.08);
  color: var(--gold-hi);
}

.pricing-close svg {
  width: 14px;
  height: 14px;
}

.pricing-head {
  padding-right: 34px;
  margin-bottom: 18px;
}

.pricing-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 31px;
  font-weight: 700;
  color: var(--gold-hi);
}

.pricing-caption {
  margin-top: 6px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  color: var(--cream-soft);
}

.pricing-toggle {
  display: inline-flex;
  padding: 3px;
  margin-bottom: 18px;
  background: rgba(201, 169, 106, 0.08);
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
}

.pricing-toggle button {
  min-width: 92px;
  height: 34px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--cream-soft);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pricing-toggle button.active {
  background: rgba(201, 169, 106, 0.16);
  color: var(--gold-hi);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pricing-card {
  position: relative;
  min-height: 334px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(201, 169, 106, 0.14);
  border-radius: 8px;
  background: rgba(12, 10, 8, 0.5);
}

.pricing-card.popular {
  border-color: rgba(222, 193, 136, 0.58);
  background: rgba(51, 40, 22, 0.62);
}

.pricing-card.current {
  box-shadow: 0 0 0 1px rgba(222, 193, 136, 0.12) inset;
}

.pricing-badge,
.pricing-current,
.pricing-marker-empty {
  width: fit-content;
  min-height: 24px;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  line-height: 16px;
}

.pricing-badge {
  background: rgba(222, 193, 136, 0.16);
  color: var(--gold-hi);
}

.pricing-current {
  background: rgba(245, 230, 200, 0.08);
  color: var(--cream-soft);
}

.pricing-marker-empty {
  visibility: hidden;
}

.pricing-card-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: var(--cream);
}

.pricing-card-price {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 700;
  color: var(--gold-hi);
}

.pricing-price-old {
  color: rgba(245, 230, 200, 0.38);
  font-size: 17px;
  font-weight: 600;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(222, 193, 136, 0.62);
}

.pricing-card-note {
  min-height: 20px;
  margin-top: 5px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  color: var(--cream-soft);
}

.pricing-limit-hero {
  margin-top: 18px;
  padding: 12px 0 14px;
  border-top: 1px solid rgba(201, 169, 106, 0.1);
  border-bottom: 1px solid rgba(201, 169, 106, 0.1);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.pricing-limit-hero strong {
  display: block;
  color: var(--cream);
  font-size: 42px;
  font-weight: 700;
  line-height: 0.95;
}

.pricing-limit-hero span {
  display: block;
  margin-top: 5px;
  color: var(--cream-soft);
  font-size: 15px;
}

.pricing-card.popular .pricing-limit-hero strong,
.pricing-card.popular .pricing-card-price {
  color: var(--gold-hi);
}

.pricing-compare {
  margin-top: 10px;
  flex: 1;
  display: grid;
  grid-template-rows: repeat(2, minmax(42px, auto));
}

.pricing-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.85fr) minmax(0, 1.15fr);
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(201, 169, 106, 0.08);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.pricing-row span {
  color: rgba(245, 230, 200, 0.48);
  font-size: 13px;
}

.pricing-row strong {
  color: var(--cream);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

.pricing-card.popular .pricing-row strong,
.pricing-card.popular .pricing-card-value {
  color: var(--gold-hi);
}

.pricing-card-value {
  min-height: 20px;
  margin-top: 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  line-height: 1.25;
  color: var(--cream);
}

.pricing-card-action {
  width: 100%;
  height: 36px;
  margin-top: 14px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: rgba(201, 169, 106, 0.12);
  color: var(--gold-hi);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pricing-card-action:hover:not(:disabled) {
  background: rgba(201, 169, 106, 0.2);
  border-color: rgba(222, 193, 136, 0.45);
}

.pricing-card-action:disabled {
  cursor: default;
  color: rgba(245, 230, 200, 0.42);
  background: rgba(245, 230, 200, 0.04);
}

.pricing-request {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--gold-faint);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.pricing-request-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  color: var(--gold-hi);
}

.pricing-request-label {
  display: block;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  color: var(--cream-soft);
}

.pricing-request-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.pricing-request-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--gold-faint);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--cream);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  outline: none;
}

.pricing-request-row input:focus {
  border-color: var(--gold-soft);
}

.pricing-request-row button {
  flex: none;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: rgba(201, 169, 106, 0.14);
  color: var(--gold-hi);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  cursor: pointer;
}

.pricing-request.busy {
  opacity: 0.7;
  pointer-events: none;
}

.pricing-request-status {
  min-height: 18px;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  color: var(--gold-hi);
}

/* ─── Auth modal ─────────────────────────────────────────────────────── */
.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 40;
}

.auth-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(400px, calc(100vw - 32px));
  transform: translate(-50%, -50%) scale(0.96);
  padding: 36px 36px 28px;
  background: linear-gradient(180deg, rgba(22, 18, 14, 0.96), rgba(18, 15, 12, 0.94));
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 1px 0 rgba(201, 169, 106, 0.12) inset,
    0 0 0 1px rgba(201, 169, 106, 0.05),
    0 30px 80px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s var(--bezier);
  z-index: 41;
  color: var(--cream);
}

.auth-modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.auth-modal > .ornament {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--gold);
  pointer-events: none;
}
.auth-modal > .ornament.tl { top: 10px; left: 10px; }
.auth-modal > .ornament.tr { top: 10px; right: 10px; transform: scaleX(-1); }
.auth-modal > .ornament.bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.auth-modal > .ornament.br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--cream-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
  z-index: 2;
}
.auth-close:hover { color: var(--gold); background: rgba(201, 169, 106, 0.08); }
.auth-close svg { width: 14px; height: 14px; }

.auth-greeting {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.55;
  color: var(--cream-soft);
  text-align: center;
  padding: 6px 4px 0;
  margin-bottom: 18px;
  position: relative;
}

.auth-greeting::before,
.auth-greeting::after {
  content: '۞';
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 14px;
  opacity: 0.55;
  letter-spacing: 0;
  margin: 6px auto;
}

.auth-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold);
  text-align: center;
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-provider-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.auth-provider:hover:not(:disabled) {
  transform: translateY(-1px);
}

.auth-provider:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-provider-mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 1px 0 rgba(255, 255, 255, 0.24) inset;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-provider:hover:not(:disabled) .auth-provider-mark {
  transform: translateY(-1px);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.42),
    0 1px 0 rgba(255, 255, 255, 0.32) inset;
}

.auth-provider-mark svg {
  display: block;
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.auth-provider-telegram .auth-provider-mark {
  background: linear-gradient(180deg, #36aee2, #1789c9);
  color: #fff;
}

.auth-provider-google .auth-provider-mark {
  background: #fff;
  color: inherit;
}

.auth-provider-google .auth-provider-mark svg {
  width: 37px;
  height: 37px;
}

.auth-provider-yandex .auth-provider-mark {
  background: #fc3f1d;
  color: #fff;
}

.auth-provider-yandex .auth-provider-mark svg {
  width: 23px;
  height: 46px;
}

.auth-error {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-strong);
  text-align: center;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-error:not(:empty) { opacity: 1; }

/* ─── Pending-question pill (post-auth recovery prompt) ──────────────── */
.pending-pill {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px 11px 18px;
  background: rgba(28, 24, 20, 0.72);
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 16px;
  color: var(--cream);
}

.pending-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-send {
  background: rgba(201, 169, 106, 0.14);
  border: 1px solid var(--gold-soft);
  color: var(--gold);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.pending-send:hover { background: rgba(201, 169, 106, 0.28); color: var(--gold-hi); }

.pending-dismiss {
  background: transparent;
  border: none;
  color: var(--cream-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.pending-dismiss:hover { color: var(--gold); background: rgba(201, 169, 106, 0.08); }
.pending-dismiss svg { width: 12px; height: 12px; }

/* Reserve vertical space for the absolute drawer-toggle at the top of ui-container. */
.chat-area { padding-top: 48px; }

/* ────────────────────────────────────────────────────────────────────────
 * Mobile (≤ 768px). Премиальная эстетика сохраняется: те же шрифты, цвета,
 * орнаменты — только layout растягивается на всю ширину минус 12-16px gutters,
 * шрифты слегка уменьшаются под узкие экраны, dev-панель скрывается.
 * ──────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* На мобиле чат занимает всю ширину; 50%-blur-оверлей перестаёт прикрывать ai-response.
   * Растягиваем blur на 100% и убираем правый fade — текст становится читаемым. */
  .blur-overlay { width: 100%; mask-image: none; -webkit-mask-image: none; }
  .blur-overlay.visible {
    background: linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.25) 70%, rgba(0,0,0,0.45));
  }

  .landing-screen {
    background-position: 50% center;
  }

  .landing-brand {
    top: 28px;
    font-size: 42px;
  }

  .landing-question {
    top: auto;
    left: 16px !important;
    right: 16px !important;
    bottom: max(38px, env(safe-area-inset-bottom, 0px));
    width: auto;
    padding: 20px 18px 18px 22px;
    border-radius: 2px;
    transform: translateY(10px);
  }

  .landing-question.visible {
    transform: translateY(0);
  }

  .landing-question::before {
    font-size: 10px;
  }

  .landing-question::after {
    content: none;
  }

  .landing-question-text {
    padding: 0;
    font-size: 26px;
  }

  .ui-container {
    top: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    width: auto;
    gap: 10px;
  }

  .chat-area { padding-top: 52px; gap: 14px; }

  .drawer-toggle {
    width: 40px; height: 40px;
  }

  .user-msg { font-size: 16px; border-radius: 14px; padding: 10px 14px; }
  .user-msg.collapsed { font-size: 14px; }

  .ai-response { font-size: 17px; padding: 4px 4px; }

  .ayat-card { padding: 22px 22px 18px; }
  .ayat-arabic { font-size: 22px; line-height: 1.7; }
  .ayat-translation { font-size: 15px; }
  .ayat-source { font-size: 11px; letter-spacing: 0.16em; }
  .ayat-card .ornament { width: 18px; height: 18px; }

  .input-wrapper { padding: 10px 52px 10px 16px; border-radius: 18px; }
  .input-wrapper textarea { font-size: 16px; }  /* 16px — Safari iOS не зумит при focus */
  .input-hint { font-size: 9px; right: 12px; bottom: 8px; }
  .input-send { width: 32px; height: 32px; right: 9px; bottom: 8px; }

  .drawer {
    width: min(320px, 92vw);
    padding: 18px 14px 14px;
  }
  .drawer-brand { font-size: 24px; }
  .drawer-new { padding: 11px 14px; font-size: 16px; }
  .drawer-item { font-size: 16px; padding: 11px 12px 11px 16px; }
  .drawer-plan { flex-basis: 100%; }

  .billing-bar {
    padding: 0;
    gap: 8px;
  }
  .billing-status,
  .billing-open {
    height: 32px;
    font-size: 14px;
  }
  .billing-open {
    padding: 0 12px;
  }

  .auth-modal {
    width: calc(100vw - 24px);
    padding: 28px 22px 22px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
  .auth-title { font-size: 24px; margin-bottom: 18px; }
  .auth-greeting { font-size: 15px; margin-bottom: 14px; }
  .auth-provider-list { gap: 12px; }
  .auth-provider { width: 62px; height: 62px; }
  .auth-provider-mark { width: 58px; height: 58px; }
  .auth-provider-mark svg { width: 29px; height: 29px; }
  .auth-provider-google .auth-provider-mark svg { width: 32px; height: 32px; }
  .auth-provider-yandex .auth-provider-mark svg { width: 20px; height: 39px; }

  .pending-pill { font-size: 14px; padding: 9px 12px 9px 14px; }
  .pending-send { font-size: 11px; padding: 6px 10px; }

  .pricing-modal {
    width: calc(100vw - 20px);
    padding: 22px 16px 16px;
    max-height: calc(100vh - 20px);
  }
  .pricing-title { font-size: 26px; }
  .pricing-caption { font-size: 15px; }
  .pricing-toggle {
    display: flex;
    width: 100%;
  }
  .pricing-toggle button {
    flex: 1;
    min-width: 0;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-card {
    min-height: 0;
  }
  .pricing-request-row {
    flex-direction: column;
  }
  .pricing-request-row button {
    width: 100%;
  }

  /* Dev-панель прячется на мобиле — на тач-устройстве она бесполезна и крадёт место. */
  #dev-panel { display: none; }
}

/* Очень узкие экраны (≤ 380px) — телефоны вроде iPhone SE. */
@media (max-width: 380px) {
  .ayat-arabic { font-size: 20px; }
  .drawer { width: calc(100vw - 32px); }
  .ui-container { left: 8px; right: 8px; }
}
