/* Ronnie Mini App — «Напарник»: the second side of the «Разговор» tab (a talk with another student) and the switch
   between the two sides. Loaded after app.css, writing.css (.whero) and grammar.css (.seg); the bubbles, the review
   frame and the composer are the ones of the talk with Ronnie. */

/* ---------- Ронни | Напарник ---------- */
.talk__switch { flex: none; padding: calc(var(--safe-top) + 10px) var(--s4) 0; }
.talk__switch .seg { margin-bottom: 0; }
.seg--sm .seg__btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; font-size: 15px; }
.seg__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  animation: pop-in 0.3s var(--spring);
}
/* the switch has taken the safe area at the top: what follows starts right under it */
.talk__switch + .screen__head { padding-top: 6px; }
.talk__switch + .screen__scroll { padding-top: var(--s3); }
/* typing: the keyboard takes half of the screen — the switch gives its room to the talk */
.kb-open .talk__switch { display: none; }
.kb-open .talk__switch + .screen__head { padding-top: calc(var(--safe-top) + 6px); }
.kb-open .talk__switch + .screen__scroll { padding-top: calc(var(--safe-top) + var(--s3)); }

/* ---------- the states before a pair ---------- */
.partner__scroll { padding-bottom: var(--s6); }
.partner__cta { margin-top: var(--s4); }

.pstate { display: flex; flex-direction: column; align-items: center; padding: var(--s5) var(--s2) 0; text-align: center; }
.pstate__badge { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: var(--s4); border-radius: 28px; background: var(--amber-tint); color: var(--amber-ink); box-shadow: 0 3px 0 #EDD49B; }
.pstate__ronnie { --ronnie-size: clamp(180px, 56vw, 240px); margin: calc(var(--ronnie-size) * -0.08) 0 calc(var(--ronnie-size) * -0.07); }
.pstate__title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.pstate__text { max-width: 330px; margin-top: var(--s2); font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.pstate__need { width: 100%; margin-top: var(--s5); text-align: left; }
.pstate__needlabel { font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber-ink); }
.pstate__needtext { margin-top: 2px; font-size: var(--fs-md); font-weight: 600; line-height: 1.4; }
.pstate__btn { max-width: 340px; margin-top: var(--s5); }

/* the rules */
.prules__title { font-size: 20px; font-weight: 800; line-height: 1.2; }
.prules__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.prules__list li { display: flex; align-items: flex-start; gap: var(--s3); font-size: 16px; line-height: 1.4; }
.prules__list li > span:last-child { min-width: 0; padding-top: 2px; }
.prules__n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-tint); color: var(--accent-ink); font-size: 14px; font-weight: 800; }
.pcheck {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 56px;
  margin-top: var(--s4);
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.pcheck input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.pcheck__box { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink-3); color: #fff; transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.pcheck__text { min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.pcheck.is-on { background: var(--green-tint); box-shadow: inset 0 0 0 2px var(--green); }
.pcheck.is-on .pcheck__box { background: var(--green); box-shadow: none; }
.pcheck input:focus-visible + .pcheck__box { outline: 3px solid rgba(216, 87, 74, 0.5); outline-offset: 2px; }

/* idle: «Неделя с Аней закончилась…» and how it works */
.pended { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); padding: 12px 14px; border-radius: var(--r-lg); background: var(--amber-tint); color: #5E4310; font-size: var(--fs-sm); line-height: 1.4; animation: rise 0.3s var(--ease); }
.pended p { flex: 1; min-width: 0; }
.pended__close { flex: none; min-height: 36px; padding: 0 12px; border-radius: 18px; background: rgba(255, 253, 247, 0.72); font-size: 14px; font-weight: 800; color: var(--amber-ink); }
.pended__close:active { transform: scale(0.95); }
.phow { margin: 0; padding: var(--s1) var(--s4); list-style: none; }
.phow li { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; font-size: 16px; line-height: 1.4; }
.phow li + li { border-top: 1px solid var(--line); }
.phow li > span:last-child { min-width: 0; }
.phow__icon { flex: none; width: 28px; font-size: 22px; line-height: 1.2; text-align: center; }

/* ---------- paired: the talk ---------- */
/* the partner's avatar: a coloured circle with the first letter of the name (six colours) */
.pavatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--av, var(--grey)); color: #fff; font-size: 20px; font-weight: 800; line-height: 1; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.pavatar--sm { width: 36px; height: 36px; font-size: 16px; }
.pavatar--0 { --av: #D8574A; }
.pavatar--1 { --av: #4C9A6A; }
.pavatar--2 { --av: #CF9027; }
.pavatar--3 { --av: #5B8FD0; }
.pavatar--4 { --av: #9A86D0; }
.pavatar--5 { --av: #8D8B92; }

/* the header and the topic of the day stay above the lines; what scrolls away under them fades out */
.pchat__top { position: relative; flex: none; padding: 6px var(--s4) var(--s2); }
.pchat__top::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; z-index: 2; background: linear-gradient(to bottom, var(--bg), rgba(245, 239, 222, 0)); pointer-events: none; }
.kb-open .pchat__top { padding-top: calc(var(--safe-top) + 6px); }
.phead { display: flex; align-items: center; gap: var(--s3); }
.phead__titles { flex: 1; min-width: 0; }
.phead__name { font-size: 20px; font-weight: 800; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead__sub { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phead__more { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border-radius: 22px; color: var(--ink-2); transition: background-color 0.15s ease, transform 0.12s var(--ease); }
.phead__more:active { background: var(--grey-tint); transform: scale(0.92); }

/* «Тема дня»: one line when folded; open — the three questions, English with the Russian under it */
.ptopic { margin-top: var(--s2); border-radius: var(--r-lg); background: var(--amber-tint); color: #5E4310; }
.ptopic__head { display: flex; align-items: center; gap: var(--s2); min-height: 52px; padding: 6px 4px 6px 14px; cursor: pointer; }
.ptopic__titles { flex: 1; min-width: 0; }
.ptopic__eyebrow { font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--amber-ink); }
.ptopic__title { font-size: var(--fs-md); font-weight: 800; line-height: 1.4; color: #3D2A06; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptopic.is-open .ptopic__title { white-space: normal; }
.ptopic__toggle { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 22px; color: var(--amber-ink); }
.ptopic__body { max-height: 40vh; overflow-y: auto; padding: 0 12px 12px; animation: rise 0.24s var(--ease); scrollbar-width: none; }
.ptopic__body::-webkit-scrollbar { display: none; }
.ptopic__ru { margin-top: -4px; padding: 0 2px; font-size: var(--fs-sm); color: var(--amber-ink); }
.ptopic__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin: var(--s2) 0 0; padding: 0; list-style: none; counter-reset: question; }
.ptopic__list li { position: relative; padding: 8px 12px 8px 42px; border-radius: 14px; background: rgba(255, 253, 247, 0.74); counter-increment: question; }
.ptopic__list li::before { content: counter(question); position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber-ink); color: #fff; font-size: 13px; font-weight: 800; line-height: 22px; text-align: center; }
.ptopic__q { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ptopic__qru { font-size: 14px; line-height: 1.35; color: var(--ink-2); }
/* typing: the questions fold away, the title stays */
.kb-open .ptopic__body { display: none; }

.pchat__scroll { padding-top: var(--s2); }
.pchat__hint { max-width: 300px; margin: var(--s5) auto 0; font-size: var(--fs-sm); line-height: 1.45; text-align: center; color: var(--ink-2); }
/* under my own line: nothing to fix */
.msg__clean { padding: 0 var(--s1); font-size: 13px; font-weight: 700; color: var(--green-ink); white-space: nowrap; }
/* my line that was not delivered: grey, with the reason under it */
.msg.is-blocked .msg__bubble { background: var(--grey-tint); color: var(--ink-3); }
.msg.is-blocked .msg__fail { max-width: 300px; }

/* ---------- ⋯: change the partner, complain ---------- */
.pmenu { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding-top: var(--s1); }
.pmenu__item { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 68px; padding: var(--s3); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-align: left; transition: transform 0.12s var(--ease); }
.pmenu__item:active { transform: scale(0.985); }
.pmenu__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--amber-tint); color: var(--amber-ink); }
.pmenu__item--warn .pmenu__icon { background: var(--accent-tint); color: var(--accent-ink); }
.pmenu__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pmenu__text b { font-size: var(--fs-md); font-weight: 800; }
.pmenu__text span { font-size: var(--fs-sm); line-height: 1.3; color: var(--ink-2); }
.pconfirm__title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.pconfirm__text { margin-top: var(--s2); font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.preasons { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.preason { min-height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2); transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s var(--ease); }
.preason:active { transform: scale(0.95); }
.preason.is-on { background: var(--ink); color: #fff; box-shadow: none; }

@media (max-height: 700px) {
  .pstate { padding-top: var(--s2); }
  .pstate__ronnie { --ronnie-size: clamp(150px, 44vw, 190px); }
  .ptopic__body { max-height: 34vh; }
}
