/* Экраны «Профиль», «Чат с ИИ» и страницы с текстами */

/* Общие кнопки */
.main-button, .line-button {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  transition: transform .35s var(--ease-spring), box-shadow .35s var(--ease-spring);
}
.main-button {
  margin-top: 20px;
  background: linear-gradient(180deg, var(--burgundy-to), var(--burgundy-from));
  box-shadow: 0 5px 0 var(--burgundy-edge);
}
.main-button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--burgundy-edge); }
.line-button { margin-top: 17px; border: 1px solid var(--gold-border); color: var(--gold); }
.line-button:active { transform: scale(.97); }
.arrow { flex: none; color: var(--gold); font-weight: 700; }

/* Профиль */
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--gold-border);
  border-radius: 50%;
  background: var(--gold-soft);
}
.profile-head__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.profile-head__text { min-width: 0; }
.profile-head__title { font-size: 22px; }
.profile-head__name { color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }

.access {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--gold-border-soft);
  border-radius: var(--radius-card-lg);
  background: radial-gradient(circle at 100% 0, var(--gold-glow), transparent 55%) var(--card-2);
}
.access__mark {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 10px;
  background: var(--gold-mark);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .08em;
}
.access__left { margin-top: 12px; font: 600 22px/1.3 var(--font-display); font-variant-numeric: tabular-nums; }
.access__track { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: var(--border); }
.access__fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--logo-mid), var(--logo-arrow)); }
.access__note { margin-top: 12px; color: var(--text-2); font-size: 13px; }

.checks { margin-top: 20px; padding: 8px 16px; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.checks svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plans { display: grid; gap: 10px; margin-top: 14px; }
.plan {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  text-align: left;
}
.plan:active { transform: scale(.98); }
.plan[aria-pressed="true"] { border-color: var(--gold-chosen-border); background: var(--gold-chosen); }
.plan__dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-3);
  border-radius: 50%;
}
.plan[aria-pressed="true"] .plan__dot { border-color: var(--gold); }
.plan[aria-pressed="true"] .plan__dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.plan__text { flex: 1; min-width: 0; }
.plan__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.plan__name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.plan__mark { padding: 3px 8px; border-radius: 8px; font-size: 10px; font-weight: 800; line-height: 1.4; letter-spacing: .04em; }
.plan__mark--burgundy { background: var(--recommend); color: var(--recommend-text); }
.plan__mark--gold { background: var(--gold-mark); color: var(--gold); }
.plan__note { display: block; margin-top: 3px; color: var(--text-2); font-size: 12px; line-height: 1.35; }
.plan__price { flex: none; font-size: 14px; font-weight: 700; }

.useful { padding: 0 16px; }
.useful__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.useful__row:first-child { border-top: 0; }

/* «Как это работает» и «Риски» */
.is-article .disclaimer { display: none; } /* эта фраза уже есть в самих текстах */
.back { display: inline-flex; align-items: center; min-height: var(--tap); padding-right: 12px; color: var(--gold); font-weight: 700; }
.article { margin-top: 12px; color: var(--text-2); }
.article p + p { margin-top: 12px; }
.article b { color: var(--text); font-weight: 700; }
.article__item { padding-left: 20px; text-indent: -20px; }

/* Чат */
.is-chat .app { padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--composer-height, 170px) + 20px); }
.chat-head { align-items: center; }
.chat-left {
  flex: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--gold-mark);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.chat-left--none { background: var(--short-soft); color: var(--stop); }
.chat-rules { margin-top: 8px; color: var(--text-2); font-size: 12px; line-height: 1.45; }
.chat-demo { display: flex; width: fit-content; margin: 16px auto 0; }
.chat-feed { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; perspective: 900px; }
.msg {
  max-width: 86%;
  scroll-margin-bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--composer-height, 170px) + 12px);
  animation: msg-in .55s var(--ease-spring) backwards;
}
.msg--question { align-self: flex-end; transform-origin: 100% 100%; }
.msg--answer { align-self: flex-start; transform-origin: 0 100%; animation-delay: .12s; }
.msg__bubble {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px 18px 18px 18px;
  background: var(--card);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.msg--question .msg__bubble { border-color: var(--question-border); border-radius: 18px 18px 6px 18px; background: var(--question); }
.msg__who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--gold); font-size: 12px; font-weight: 700; }
.msg__dot { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--logo-light), var(--logo-mid) 55%, var(--logo-dark)); }

/* Поле ввода над меню. Лежит вне .screens: там fixed не работает из-за perspective. */
.composer {
  position: fixed;
  z-index: 9;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: 0;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 10px 0 8px;
  border-top: 1px solid var(--nav-border);
  background: var(--bg);
}
.is-typing .composer { bottom: var(--keyboard, 0px); }
.is-typing .nav { display: none; }
.composer__hints {
  display: flex;
  gap: 8px;
  padding: 0 var(--gutter) 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer__hints::-webkit-scrollbar { display: none; }
.composer__hint {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.composer__hint:focus-visible { outline-offset: -3px; }
.composer__form { display: flex; gap: 8px; padding: 0 var(--gutter); }
.composer__field { position: relative; flex: 1; min-width: 0; }
.composer__input {
  width: 100%;
  height: 52px;
  padding: 0 62px 0 14px;
  border: 1px solid var(--gold-border-soft);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  font: 500 16px var(--font-text); /* меньше 16px — iPhone увеличивает страницу */
}
.composer__input::placeholder { color: var(--text-3); font-size: 14px; opacity: 1; }
.composer__counter {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--text-3);
  font-size: 11px;
  transform: translateY(-50%);
  pointer-events: none;
}
.composer__counter--warn { color: var(--short); font-weight: 700; }
.composer__send {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--burgundy-to), var(--burgundy-from));
}
.composer__form :disabled, .composer__hint:disabled { opacity: .45; }
.composer__send svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.composer__ended {
  margin: 0 var(--gutter);
  padding: 14px 16px;
  border: 1px solid var(--limit-border);
  border-radius: 16px;
  background: var(--limit);
  color: var(--limit-text);
  font-size: 13px;
}
.composer__ended:focus { outline: none; }
.composer__fine { margin-top: 8px; padding: 0 var(--gutter); color: var(--text-3); font-size: 11px; line-height: 1.3; text-align: center; }

@keyframes msg-in { from { opacity: 0; transform: translateY(16px) scale(.86) rotateX(-18deg); } }

@media (max-width: 350px) {
  .access { padding: 16px; }
  .access__left { font-size: 19px; }
  .plan { gap: 10px; padding: 12px; }
  .composer__hints, .composer__form { padding-right: 12px; padding-left: 12px; }
  .composer__form { gap: 6px; }
  .composer__ended { margin: 0 12px; }
  .composer__input { padding: 0 48px 0 10px; }
  .composer__input:placeholder-shown { padding-right: 36px; }
  .composer__input::placeholder { font-size: 12px; letter-spacing: -.02em; }
  .composer__counter { right: 8px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .main-button:active, .line-button:active, .plan:active { transform: none; }
}
