/* ---------- Этап 8: личный кабинет и сообщество ---------- */
/* атрибут hidden сильнее классов вроде .btn { display: inline-block } */
[hidden] { display: none !important; }
turbo-frame { display: block; }
button.btn { font-family: inherit; }
button.btn--block { width: 100%; }
.btn--on {
  background: linear-gradient(#fff6d9, #ffe39a); color: #5a4300;
  border: 1px solid #e2b93b; box-shadow: inset 0 1px 0 #fff;
}
.btn.is-voted { box-shadow: 0 0 0 2px #ffd36a, inset 0 1px 0 rgba(255,255,255,.25); }
.shelves form { margin: 0; }

/* иконки в шапке (полки, история) */
.header__icon-link { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius); }
.header__icon-link svg { width: 17px; height: 17px; fill: var(--header-link); }
.header__icon-link:hover { background: var(--header-active); }
.header__icon-link:hover svg { fill: var(--yellow); }

/* вертикальная вкладка «Обратная связь» слева, как в оригинале */
.feedback-tab {
  position: fixed; left: 0; top: 50%; z-index: 40; transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  padding: 12px 6px; background: var(--yellow); color: #222; font-size: 12px; font-weight: bold;
  border-radius: var(--radius) 0 0 var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.feedback-tab:hover { text-decoration: none; filter: brightness(1.06); }
.footer a { color: #9fb0c6; }

/* отзывы — цвета оригинала: зелёный (положительный) / красный (отрицательный) */
.reviews { margin-top: 14px; }
.reviews__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #c9d6e3; padding-bottom: 6px; }
.reviews__head .block__title { margin: 0; }
.reviews__empty { color: var(--muted); padding: 14px 0 4px; }
.review { display: flex; gap: 10px; margin-top: 12px; padding: 9px 10px 8px 9px; border: 1px solid #dde1e6; border-radius: 4px; background: #f7f8fa; }
.review--positive { border-color: #bae8c2; background: #ecffe8; }
.review--negative { border-color: #e8baba; background: #ffe8e8; }
.review__avatar {
  flex: none; width: 50px; height: 50px; border-radius: 4px; background: #c7d1dd; color: #fff;
  font-size: 22px; line-height: 50px; text-align: center; font-weight: bold;
}
.review__body { flex: 1; min-width: 0; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.review__author { font-size: 12px; color: var(--link); }
.review__time { font-size: 11px; color: var(--muted); }
.review__helpful { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.review__question { font-size: 11px; color: #808080; margin-right: 2px; }
.review__answer {
  display: inline-flex; gap: 4px; align-items: center; height: 20px; padding: 0 7px; font: inherit; font-size: 11px;
  color: #808080; background: transparent; border: 1px solid #ccd3db; border-radius: 3px; cursor: pointer;
}
.review__answer b { font-weight: normal; }
.review__answer--yes b { color: #29b54a; }
.review__answer--no b { color: #f00; }
.review--positive .review__answer { border-color: #bae8c2; }
.review--negative .review__answer { border-color: #e8baba; }
.review__answer--yes:not(.is-static):hover, .review__answer--yes.is-on { background: #bae8c2; border-color: #bae8c2; }
.review__answer--no:not(.is-static):hover, .review__answer--no.is-on { background: #e8baba; border-color: #e8baba; }
.review__answer.is-static { cursor: default; }
.review__text { margin-top: 8px; font: 13px/17px Verdana, sans-serif; color: #000; overflow-wrap: anywhere; }
.review__foot { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 6px; font-size: 11px; }
.review__foot a, .review__foot .linklike { color: #8a96a3; }
.review__complain summary { cursor: pointer; color: #8a96a3; text-decoration: underline; list-style: none; }
.review__complain summary::-webkit-details-marker { display: none; }
.review__complain form { display: flex; gap: 6px; margin-top: 6px; }
.review__complain select { font: inherit; font-size: 12px; }
.review__reported { color: var(--muted); }
.review-about { display: flex; gap: 10px; align-items: baseline; margin: 0 0 12px; }

/* форма отзыва и обратной связи */
.form--wide { max-width: 640px; }
.account:has(.form--wide) { max-width: 640px; }
.form textarea, .form select {
  padding: 6px 8px; border: 1px solid #c9d0d9; border-radius: var(--radius); font: inherit; font-size: 14px; resize: vertical;
}
.form select { height: 32px; padding: 0 6px; }
.form textarea:focus, .form select:focus { outline: 2px solid #9cc3ea; border-color: #5b8fc4; }
.tone { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.tone legend { width: 100%; margin-bottom: 6px; font-size: 12px; color: #444; }
.tone ul { width: 100%; }
.form .tone__option { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #dde1e6; border-radius: 4px; cursor: pointer; font-size: 13px; color: #333; }
.tone__option--positive { background: #ecffe8; border-color: #bae8c2 !important; }
.tone__option--negative { background: #ffe8e8; border-color: #e8baba !important; }
.tone__option--neutral { background: #f7f8fa; }
.tone__option:has(input:checked) { box-shadow: 0 0 0 2px #5b8fc4; }
.account__lead { color: #555; margin: 0 0 14px; line-height: 1.5; }
.account__cancel { margin-left: 12px; }
.form > .btn { justify-self: start; }
.flash--info { background: #eef4fb; border: 1px solid #c9dbef; }

/* личный кабинет */
.cabinet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cabinet__avatar {
  width: 48px; height: 48px; border-radius: 4px; background: var(--yellow); color: #222;
  font-size: 22px; line-height: 48px; text-align: center; font-weight: bold;
}
.cabinet__name { margin: 0; font-size: 18px; color: var(--title); font-weight: normal; }
.cabinet__since { font-size: 11px; color: var(--muted); }
.cabinet__tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--header-bg); overflow-x: auto; }
.cabinet__tab { padding: 6px 14px; background: var(--panel); color: var(--link); border-radius: 3px 3px 0 0; white-space: nowrap; font-size: 13px; }
.cabinet__tab:hover { background: #e6ebf1; text-decoration: none; }
.cabinet__tab.is-active { background: var(--header-bg); color: #fff; }
.cabinet__body { padding-top: 14px; }
.cabinet__body > .account__info, .cabinet__body > .form, .cabinet__body > h2 { max-width: 460px; }
.shelf-tabs { margin-bottom: 12px; }
.shelf-tabs__count { color: var(--muted); font-weight: normal; }

/* история просмотра */
.history__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.history { list-style: none; margin: 0; padding: 0; }
.history__item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history__poster { flex: none; width: 54px; height: 80px; background: linear-gradient(160deg, #e9ecf0, #d5dae2); overflow: hidden; border-radius: 2px; }
.history__poster img { width: 100%; height: 100%; object-fit: cover; }
.history__poster .poster__stub { font-size: 9px; }
.history__info { flex: 1; min-width: 0; }
.history__title { font-size: 14px; }
.history__meta { margin: 3px 0 6px; font-size: 12px; color: #555; }
.history__when { margin-top: 4px; font-size: 11px; color: var(--muted); }
.history__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11px; }
.progress { height: 4px; max-width: 320px; background: #dde3ea; border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--yellow); }

/* «Обсуждаемые материалы» на главной: карусель с прокруткой */
.discussed {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 20px) / 3); gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
}
.discussed__item { display: flex; gap: 8px; padding: 8px; background: #fff; border: 1px solid #dfe2e6; border-radius: 3px; scroll-snap-align: start; }
.discussed__poster { flex: none; width: 60px; height: 90px; background: linear-gradient(160deg, #e9ecf0, #d5dae2); overflow: hidden; }
.discussed__poster img { width: 100%; height: 100%; object-fit: cover; }
.discussed__poster .poster__stub { font-size: 9px; }
.discussed__body { min-width: 0; }
.discussed__title { display: block; font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.discussed__review { margin: 4px 0 0; padding: 3px 6px; font-size: 11px; line-height: 1.35; color: #333; border-left: 3px solid #ccd3db; background: #f7f8fa; }
.discussed__review--positive { border-color: #6bca79; background: #f1fbef; }
.discussed__review--negative { border-color: #d45b5f; background: #fff2f2; }

@media (max-width: 760px) {
  .feedback-tab { display: none; }
  .header__icon-link { display: none; }
  .discussed { grid-auto-columns: 85%; }
  .review__avatar { display: none; }
  .review__helpful { margin-left: 0; width: 100%; }
  .history__item { flex-wrap: wrap; }
  .history__actions { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; }
}
