/* ==========================================================================
   RUS.DO — форум. Спокойный вертикальный ритм, тонкие разделители, читаемая мера.
   Только токены из app.css — тёмная тема работает автоматически.
   ========================================================================== */

/* ---------- Шапка раздела ---------- */
.fhero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); gap: var(--s-5) var(--s-6); align-items: end; padding: var(--s-2) 0 var(--s-5); }
.fhero__h { font-size: var(--fs-2xl); letter-spacing: -.028em; display: flex; align-items: center; gap: 14px; }
.fhero__sub { color: var(--ink-3); margin-top: 8px; max-width: 62ch; font-size: var(--fs); }
.fhero__dot { width: 44px; height: 44px; border-radius: 14px; display: inline-grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.fhero__actions { display: grid; gap: 10px; }
.fhero__cta { justify-self: end; }
.fsearch { position: relative; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 6px 0 16px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-1);
  transition: border-color var(--dur), box-shadow var(--dur); }
.fsearch:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-50); }
.fsearch > .i { color: var(--ink-3); }
.fsearch input[type=search] { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 15.5px; }
.fsearch input::placeholder { color: var(--ink-3); }
.fsearch input::-webkit-search-cancel-button { display: none; }

/* ---------- Раскладка списка ---------- */
.fwrap { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.fchips { display: none; margin-bottom: var(--s-4) !important; }
.fchips .chip { flex: none; white-space: nowrap; }

.fnav { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: var(--s-4); font-size: 14.5px;
  max-height: calc(100vh - var(--hdr-h) - 32px); overflow-y: auto; scrollbar-width: thin; padding-bottom: var(--s-4); }
.fnav__all, .fnav__a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--ink-2); transition: background var(--dur), color var(--dur); }
.fnav__all { font-weight: 700; color: var(--ink); justify-content: space-between; }
.fnav__all:hover, .fnav__a:hover { background: var(--surface-2); color: var(--ink); }
.fnav__all.is-active, .fnav__a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); outline: 1px solid var(--line); }
.fnav__h { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px 6px; }
.fnav__ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.fnav__name { flex: 1; min-width: 0; line-height: 1.3; }
.fnav__n { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.fmain { min-width: 0; }
.fbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.ftabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: 1; min-width: 0; }
.ftabs::-webkit-scrollbar { display: none; }
.ftab { position: relative; padding: 10px 12px 12px; font-weight: 600; font-size: 14.5px; color: var(--ink-3); white-space: nowrap; transition: color var(--dur); }
.ftab:hover { color: var(--ink); }
.ftab.is-active { color: var(--ink); }
.ftab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--coral); }
.fcity { position: relative; display: flex; align-items: center; flex: none; }
.fcity > .i { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; }
.fcity select { appearance: none; -webkit-appearance: none; height: 38px; padding: 0 30px 0 32px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface) linear-gradient(45deg, transparent 50%, var(--ink-3) 50%) no-repeat right 15px center / 5px 5px; font-size: 14px; font-weight: 500; cursor: pointer; }
.fcity select:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.flist { overflow: hidden; }
.flist .trow__title { font-size: 16.5px; }

/* ---------- Плавающая CTA (мобайл) ---------- */
.ffab { display: none; }
@media (max-width: 860px) {
  .ffab { position: fixed; z-index: calc(var(--z-nav) - 1); right: 16px; bottom: calc(var(--bnav-h) + 22px + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 16px;
    background: var(--coral); color: #fff; font-weight: 700; font-size: 14.5px; box-shadow: 0 10px 24px rgba(229, 101, 79, .34); }
  .ffab:active { transform: scale(.98); }
}

/* ---------- Тема ---------- */
.ftopic { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-7); align-items: start; }
.ftopic__main { min-width: 0; max-width: 820px; }
.fthead { padding: var(--s-2) 0 var(--s-5); border-bottom: 1px solid var(--line); }
.fthead__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; margin-bottom: 14px; }
.fthead__city { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.fthead__h { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; line-height: 1.15; max-width: 30ch; }
.fthead__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; color: var(--ink-3); font-size: 13.5px; }
.fthead__meta span + span::before { content: "·"; margin-right: 16px; margin-left: -8px; opacity: .6; }

/* Пост: колонка автора слева на десктопе, строка на мобайле */
.fpost { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-5) 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--hdr-h) + 16px); }
.fpost:target { animation: fpost-flash 2.2s var(--ease); }
@keyframes fpost-flash { 0%, 30% { background: var(--teal-50); box-shadow: 0 0 0 12px var(--teal-50); } 100% { background: transparent; box-shadow: 0 0 0 12px transparent; } }
.fpost--op { border-bottom: 0; padding-bottom: var(--s-4); }
.fpost--op .fprose { font-size: var(--fs-md); }
.fpost--hidden { opacity: .66; }
.fauthor { display: grid; justify-items: start; gap: 8px; align-content: start; min-width: 0; }
.fauthor__txt { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.fauthor__name { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; line-height: 1.3; max-width: 100%; overflow-wrap: anywhere; }
.ffounder { color: var(--amber); display: inline-flex; }
.ffounder .i { fill: currentColor; }
.fpost__main { min-width: 0; }
.fpost__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; min-height: 20px; }
.fpost__mname { display: none; }
.fpost__time:hover { color: var(--teal-600); }
.fpost__op { color: var(--teal-600); font-weight: 600; }
.fpost__sol { display: inline-flex; align-items: center; gap: 4px; color: var(--palm); font-weight: 700; }

.fprose { font-size: 16.5px; line-height: 1.68; max-width: 68ch; overflow-wrap: break-word; }
.fprose > * + * { margin-top: .8em; }
.fprose h2 { font-size: 21px; margin-top: 1.4em; } .fprose h3 { font-size: 18.5px; margin-top: 1.2em; }
.fprose blockquote { font-size: .95em; background: var(--surface-2); border-left-color: var(--line-2); border-radius: 0 10px 10px 0; padding: 8px 14px; }
.fprose blockquote > * + * { margin-top: .5em; }
.fprose .mention { color: var(--teal-600); font-weight: 600; text-decoration: none; }
.fprose img { border-radius: 12px; }

/* Действия под постом */
.fpost__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 12px; margin-left: -10px; }
.fact { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-3);
  transition: background var(--dur), color var(--dur); cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.fact::-webkit-details-marker { display: none; }
.fact:hover { background: var(--surface-2); color: var(--ink); }
.fact__n:empty { display: none; }
.fact__n { font-variant-numeric: tabular-nums; }
.fact--thanks.is-on { color: var(--coral); }
.fact--thanks.is-on .i { fill: currentColor; }
.fact--solve:hover, .fact--solve.is-on { color: var(--palm); background: var(--palm-50); }
.fact--quiet { margin-left: auto; font-weight: 500; }
.fact--quiet span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fact--pill { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 0 14px; }
.fact--pill.is-on { color: var(--teal-600); border-color: var(--teal); background: var(--teal-50); }
.fact--accent { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fact--accent:hover { background: var(--ink-2); color: var(--bg); }

.fedit { display: contents; }
.fedit[open] .fedit__form { flex-basis: 100%; order: 10; margin: 10px 0 0 10px; }
.fedit__form .field { margin-bottom: 0; }
.fedit__form .form-actions { margin-top: var(--s-3); }

/* Блок «Решение» — сразу под вопросом */
.fsolution { position: relative; margin: 0 0 var(--s-5) calc(148px + var(--s-5)); padding: var(--s-4) var(--s-5) var(--s-5); border-radius: var(--r);
  background: var(--palm-50); border: 1px solid color-mix(in srgb, var(--palm) 28%, transparent); }
.fsolution__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.fsolution__badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--palm); letter-spacing: .01em; text-transform: uppercase; font-size: 12.5px; }
.fsolution__go { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--palm); font-weight: 700; }
.fsolution__go:hover { text-decoration: underline; text-underline-offset: 3px; }
.fsolution .fprose { max-height: 420px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }

.fpost--solved .fpost__main { position: relative; }
.fpost--solved .fpost__main::before { content: ""; position: absolute; left: calc(-1 * var(--s-5) / 2 - 1px); top: 2px; bottom: 2px; width: 3px; border-radius: 3px; background: var(--palm); }

/* Панель темы */
.ftbar { display: flex; flex-wrap: wrap; gap: 8px; padding: var(--s-3) 0 var(--s-5) calc(148px + var(--s-5)); border-bottom: 1px solid var(--line); }

.freplies__h { font-size: 15px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; padding: var(--s-6) 0 var(--s-2); border-bottom: 1px solid var(--line); }
.freplies__empty { padding: var(--s-5) 0; }

.fnotice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 14.5px; margin: var(--s-4) 0; }
.fnotice a { color: var(--teal-600); font-weight: 600; }
.fnotice--warn { background: var(--amber-50); color: var(--ink); }
.fnotice--warn .i { color: var(--amber); }

/* Композер ответа */
.fcompose { position: relative; margin-top: var(--s-6); padding: var(--s-4) var(--s-5); border-radius: var(--r);
  background: var(--glass-bg-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-2); scroll-margin-bottom: 24px; }
.fcompose__h { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.fcompose__field { margin-bottom: 0; }
.fcompose textarea { min-height: 96px; max-height: 50vh; field-sizing: content; background: var(--surface); }
.fcompose__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; }
.fcompose__hint { font-size: 12.5px; color: var(--ink-3); }
.fcompose__hint b { font-weight: 700; color: var(--ink-2); }
.fcompose__bar .draft-note { margin-right: auto; font-size: 12.5px; }
.fcompose__bar .btn { margin-left: auto; }
.fcompose__guest { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.fcompose .form-error { margin-top: 8px; }

/* Сайдбар темы */
.ftopic__side { min-width: 0; padding-top: var(--s-2); }
.fside { display: grid; gap: var(--s-4); }
.fside__box { padding: var(--s-4) var(--s-4) var(--s-4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.fside__h { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 6px; }
.fside__list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.fside__list li:last-child { border-bottom: 0; margin-bottom: 6px; }
.fside__list a { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.fside__list a:hover { color: var(--teal-600); }
.fside__meta { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.fside__ok { display: inline-flex; align-items: center; gap: 3px; color: var(--palm); font-weight: 600; }
.fside__guide { display: grid; gap: 6px; padding: var(--s-4); border-radius: var(--r); background: var(--teal-50); color: var(--ink); transition: transform var(--dur) var(--ease); }
.fside__guide:hover { transform: translateY(-1px); }
.fside__guide strong { font-size: 15.5px; line-height: 1.35; }
.fside__k { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--teal-600); text-transform: uppercase; letter-spacing: .06em; }
.fside__guide .muted { font-size: 13px; }
.fside__ask p { font-weight: 600; margin-bottom: 10px; font-size: 14.5px; }

/* ---------- Новая тема ---------- */
.fnew { max-width: 800px; }
.fnew__head { padding: var(--s-2) 0 var(--s-5); }
.fnew__form textarea { min-height: 220px; }
.fnew__form .chip .i { color: var(--ink-3); }
.fnew__form .chip:has(input:checked) .i { color: inherit; }
.fsimilar { margin: -6px 0 var(--s-4); padding: 12px 16px; border-radius: 14px; background: var(--amber-50); }
.fsimilar__h { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.fsimilar__h .i { color: var(--amber); }
.fsimilar li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.fsimilar li:first-child { border-top: 0; }
.fsimilar a { font-weight: 600; color: var(--teal-600); font-size: 14.5px; }
.fsimilar a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fsimilar span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .ftopic { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .ftopic__main { max-width: none; }
  .ftopic__side .sticky { position: static; }
  .fside { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 1024px) {
  .fwrap { grid-template-columns: minmax(0, 1fr); }
  .fnav { display: none; }
  .fchips { display: flex; }
}
@media (max-width: 860px) {
  .fhero { grid-template-columns: 1fr; gap: var(--s-4); }
  .fhero__cta { display: none; }

}
@media (max-width: 720px) {
  .fpost { grid-template-columns: 1fr; gap: 10px; padding: var(--s-4) 0; }
  .fauthor { grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
  .fauthor .ava { width: 36px !important; height: 36px !important; font-size: 14px !important; }
  .fauthor__txt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .fpost__meta { margin-bottom: 6px; }
  .fsolution { margin-left: 0; padding: var(--s-4); }
  .ftbar { padding-left: 0; gap: 6px; }
  .ftbar .fact--accent { display: none; }
  .fprose { font-size: 16px; line-height: 1.62; }
  .fpost--op .fprose { font-size: 16.5px; }
  .fpost__acts { margin-left: -8px; }
  .fact { padding: 0 8px; }
  .fpost--solved .fpost__main::before { display: none; }
  .fpost--solved { box-shadow: inset 3px 0 0 var(--palm); padding-left: 12px; }
}
@media (max-width: 640px) {
  .fhero__h { font-size: 26px; }
  .fhero__sub { font-size: 15px; }
  .fthead__h { font-size: 25px; }
  .fsearch { height: 48px; }
  .fsearch .btn { display: none; }
  .fbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ftabs { margin: 0 calc(-1 * var(--s-4)); padding: 0 var(--s-4); }
  .ftab { padding: 10px 10px 12px; }
  .fcity { align-self: flex-start; }
  .flist { border-radius: var(--r-sm); margin: 0 calc(-1 * var(--s-2)); }
  .fcompose { padding: var(--s-4); margin-left: calc(-1 * var(--s-2)); margin-right: calc(-1 * var(--s-2)); }
  .fcompose__hint { display: none; }
  .fcompose__bar .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .fpost:target { animation: none; } }
@media (max-width: 640px) {
  .crumbs [aria-current="page"] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
