/* Итоговый тест, словарь терминов, прогресс */

/* ---------- итоговый тест: выбор режима ---------- */
.final-hero { display: block; }
.final-hero .fh-cta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.final-hero .badge { background: rgba(255, 255, 255, .16); color: #F8EFE4; }
.final-hero:hover .btn-main svg { transform: translateX(3px); }
.fin-h { font-size: 22px; margin: 34px 0 14px; }
.fin-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fin-mode { display: flex; flex-direction: column; }
.fin-mode img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; transition: transform .8s var(--ease-out); }
.fin-mode:hover img { transform: scale(1.05); }
.fin-mode .body { padding: 14px 16px 16px; display: grid; gap: 4px; flex: 1; align-content: start; }
.fin-mode small { font: 800 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.fin-mode b { font: 800 17px/1.25 var(--f-head); }
.fin-mode .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font: 600 13px var(--f-head); color: var(--text-2); }
.fin-miss { margin-top: 14px; padding: 18px 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.fin-miss b { font: 800 17px var(--f-head); }
.fin-miss p { font-size: 14.5px; color: var(--text-2); margin-top: 2px; }
.fin-miss.empty .ic { background: var(--surface-2); color: var(--text-2); }

/* ---------- итоговый тест: прохождение ---------- */
.fin-head { margin-bottom: 18px; }
.fin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-radius: var(--r-m); background: var(--surface-2); margin-bottom: 18px; }
.fin-bar .muted { font-size: 14.5px; }
.fin-bar .btn { min-height: 42px; padding: 9px 16px; font-size: 15px; }
.topics-res { margin-top: 16px; padding: 22px 24px; display: grid; gap: 10px; }
.topics-res h2 { font-size: 21px; }
.topics-res .muted { font-size: 14.5px; margin-top: -4px; }
.topics-res .row a { font-weight: 600; }
.topics-res .row a:hover { color: var(--accent-text); }
.topics-res .row .r.lo { color: var(--err); } .topics-res .row .r.mi { color: var(--warn); } .topics-res .row .r.hi { color: var(--ok); }
@media screen and (min-width: 1180px) { .topics-res .rows { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; } }

/* ---------- словарь ---------- */
.gl-tools { position: sticky; top: 10px; z-index: 20; display: grid; gap: 10px; padding: 12px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-m); }
.gl-search { position: relative; display: flex; align-items: center; }
.gl-search > svg { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--text-2); pointer-events: none; }
.gl-search input { width: 100%; min-height: 50px; padding: 12px 48px 12px 44px; border-radius: 13px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); font: 500 16px var(--f-body); outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.gl-search input::-webkit-search-cancel-button { display: none; }
.gl-search input::placeholder { color: var(--text-2); opacity: .8; }
.gl-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gl-clear { position: absolute; right: 6px; width: 38px; height: 38px; border-radius: 10px; font: 500 24px/1 var(--f-body); color: var(--text-2); }
.gl-clear:hover { background: var(--surface-2); color: var(--text); }
.gl-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.gl-f { min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: 700 14px var(--f-head); color: var(--text-2); transition: all .2s ease; }
.gl-f:hover { color: var(--text); border-color: var(--line-strong); }
.gl-f[aria-pressed="true"] { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--on-accent); }
.gl-abc { display: flex; gap: 2px; flex-wrap: wrap; }
.gl-abc button { min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; font: 800 14px var(--f-head); color: var(--accent-text); }
.gl-abc button:hover:not(:disabled) { background: var(--accent-soft); }
.gl-abc button:disabled { color: var(--text-2); opacity: .35; cursor: default; }
.gl-count { min-height: 22px; margin: 14px 2px 0; font: 600 14px var(--f-head); color: var(--text-2); }
.gl-list { display: grid; gap: 26px; margin-top: 6px; }
.gl-group h2 { font-size: 30px; color: var(--accent-text); margin-bottom: 12px; display: flex; align-items: center; gap: 14px; }
.gl-group h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gl-item { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.gl-item[hidden], .gl-group[hidden] { display: none; }
.gl-item h3 { font-size: 18px; line-height: 1.3; }
.gl-item p { font-size: 15px; color: var(--text); }
.gl-item p.also { font-size: 14px; color: var(--text-2); }
.gl-item p.also b { font-family: var(--f-head); color: var(--text); }
.gl-item mark { background: var(--warn-soft); color: inherit; border-radius: 4px; padding: 0 2px; box-shadow: 0 2px 0 var(--accent-2); }
.gl-src { display: grid; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.gl-link { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 9px; font-size: 13.5px; line-height: 1.4; color: var(--text-2); transition: background-color .2s, color .2s; }
.gl-link svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.gl-link b { font-family: var(--f-head); color: var(--accent-text); }
.gl-link:hover { background: var(--accent-soft); color: var(--text); }
.gl-empty { margin-top: 10px; }
.gl-empty[hidden] { display: none; }
/* термин, к которому пришли из словаря */
.t.pulse { animation: termpulse 2.4s ease; border-radius: 4px; }
@keyframes termpulse { 0%, 40%, 80% { background: var(--warn-soft); box-shadow: 0 0 0 4px var(--warn-soft); } 20%, 60% { background: transparent; box-shadow: 0 0 0 0 transparent; } 100% { background: transparent; box-shadow: none; } }

/* ---------- прогресс ---------- */
.pg-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pg-tile { padding: 18px 20px; display: grid; gap: 4px; align-content: start; }
.pg-tile b { font: 800 32px/1.1 var(--f-head); letter-spacing: -.02em; }
.pg-tile b i { font-style: normal; font-size: 18px; color: var(--text-2); font-weight: 700; }
.pg-tile > span { font-size: 14px; color: var(--text-2); }
.pg-tile small { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.pg-tile small .bar { display: block; flex: none; }
.pg-two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.pg-next { padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-content: start; border-color: var(--accent); }
.pg-next small { font: 800 12px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.pg-next b { display: block; font: 800 19px/1.3 var(--f-head); margin-top: 4px; }
.pg-next p { font-size: 14.5px; color: var(--text-2); margin-top: 4px; }
.pg-next .btn { grid-column: 2; justify-self: start; }
.pg-weak { padding: 20px 22px; display: grid; gap: 10px; align-content: start; }
.pg-weak h2 { font-size: 19px; }
.pg-weak ul { display: grid; gap: 2px; }
.pg-weak li { list-style: none; }
.pg-weak li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; font-size: 14.5px; }
.pg-weak li a:hover { background: var(--surface-2); }
.pg-miss { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); font: 600 14.5px var(--f-head); color: var(--text); margin-top: 4px; }
.pg-miss svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.pg-miss span { flex: 1; }
.pg-miss b { color: var(--accent-text); }
.pg-res { flex: none; justify-self: end; min-width: 54px; text-align: center; padding: 4px 10px; border-radius: 999px; font: 800 13px var(--f-head); }
.pg-res.hi { background: var(--ok-soft); color: var(--ok); }
.pg-res.mi { background: var(--warn-soft); color: var(--warn); }
.pg-res.lo { background: var(--err-soft); color: var(--err); }
.pg-res.none { color: var(--text-2); background: var(--surface-2); }
.pg-mod { margin-top: 34px; }
.pg-mod h2 { font-size: 21px; margin-bottom: 12px; display: grid; gap: 2px; }
.pg-mod h2 small { font: 800 12px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.prog-row { grid-template-columns: 44px minmax(0, 1fr) 160px 64px; }
.prog-row .pr-t { display: grid; gap: 2px; min-width: 0; }
.prog-row .pr-t small { font-size: 12.5px; color: var(--text-2); }
.pg-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pg-sch { padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.pg-sch .ic { width: 36px; height: 36px; flex: none; }
.pg-sch .ic svg { width: 19px; height: 19px; }
.pg-sch b { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 700 15px/1.3 var(--f-head); }
.pg-reset { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pg-reset .muted { font-size: 14px; max-width: 52ch; }

/* ---------- адаптив ---------- */
@media screen and (max-width: 1100px) {
  .pg-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 900px) {
  .fin-modes { grid-template-columns: minmax(0, 1fr); }
  .fin-mode { flex-direction: row; }
  .fin-mode img { width: 34%; aspect-ratio: auto; flex: none; }
  .pg-two { grid-template-columns: minmax(0, 1fr); }
  .gl-grid { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 767px) {
  .fin-h { font-size: 19px; margin: 26px 0 10px; }
  .fin-mode .body { padding: 12px 14px; }
  .fin-mode b { font-size: 15.5px; }
  .fin-miss { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 12px 14px; }
  .fin-miss .link { grid-column: 2; }
  .fin-bar { padding: 12px 14px; }
  .fin-bar .btn { width: 100%; }
  .topics-res { padding: 18px; }
  .gl-tools { position: static; padding: 10px; }
  .gl-abc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; }
  .gl-abc::-webkit-scrollbar { display: none; }
  .gl-abc button { flex: none; min-width: 36px; height: 36px; }
  .gl-group h2 { font-size: 26px; }
  .gl-item { padding: 16px; }
  .gl-item h3 { font-size: 17px; }
  .pg-tiles { gap: 10px; }
  .pg-tile { padding: 14px 16px; }
  .pg-tile b { font-size: 26px; }
  .pg-tile b i { font-size: 15px; }
  .pg-tile > span { font-size: 13px; }
  .pg-next { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 12px; }
  .pg-next .ic { display: none; }
  .pg-next .btn { grid-column: 1; width: 100%; }
  .pg-weak { padding: 18px; }
  .prog-row { grid-template-columns: 40px minmax(0, 1fr) 58px; }
  .pg-schemes { grid-template-columns: minmax(0, 1fr); }
  .pg-reset .btn { width: 100%; }
}

/* ---------- общее: «Наверх», «Перейти к содержанию» ---------- */
.to-top { position: fixed; z-index: 34; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent-text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-m); opacity: 0; transform: translateY(14px) scale(.85); pointer-events: none; transition: opacity .25s ease, transform .35s var(--ease-spring), border-color .2s; }
.to-top svg { width: 22px; height: 22px; transition: transform .25s var(--ease-out); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--accent); }
.to-top:hover svg { transform: translateY(-2px); }
.skip { position: fixed; z-index: 120; left: 12px; top: 12px; padding: 12px 18px; border-radius: 12px; background: var(--accent-btn); color: var(--on-accent); font: 700 15px var(--f-head); transform: translateY(-160%); transition: transform .2s ease; }
.skip:focus { transform: none; }
#main:focus { outline: none; }
@media screen and (max-width: 1179px) {
  body:has(.toc-btn) .to-top { bottom: 82px; right: 18px; }
}
@media screen and (max-width: 767px) {
  .to-top { right: 14px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; }
  body:has(.toc-btn) .to-top { bottom: calc(144px + env(safe-area-inset-bottom, 0px)); right: 14px; }
}

/* ---------- карточки терминов ---------- */
.gl-item { position: relative; }
.gl-known { position: absolute; top: 16px; right: 16px; padding: 3px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font: 800 12px var(--f-head); }
.gl-item h3 { padding-right: 80px; }
.fc { max-width: 720px; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.fc-toggle { display: inline-flex; align-items: center; gap: 10px; font: 600 14px var(--f-head); color: var(--text-2); cursor: pointer; user-select: none; }
.fc-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fc-toggle .sw { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; flex: none; }
.fc-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--ease-spring); }
.fc-toggle input:checked + .sw { background: var(--accent-btn); }
.fc-toggle input:checked + .sw::after { transform: translateX(16px); }
.fc-toggle input:focus-visible + .sw { outline: 2.5px solid var(--accent); outline-offset: 3px; }
.fc-stats { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 18px 0 14px; font: 600 14px var(--f-head); color: var(--text-2); }
.fc-stats > span:first-child b { color: var(--text); }
.fc-stats .bar { flex: 1 1 140px; min-width: 120px; }
.fc-stats .bar i { background: linear-gradient(90deg, var(--ok), #8FC79F); }
.fc-round { font-size: 13px; }
b.ok { color: var(--ok); } b.no { color: var(--err); }
.fc-stage { display: grid; gap: 12px; }
.fc-meta { display: flex; align-items: center; justify-content: space-between; font: 600 13.5px var(--f-head); color: var(--text-2); }
.fc-tag { padding: 3px 10px; border-radius: 999px; font: 800 12px var(--f-head); }
.fc-tag.new { background: var(--surface-2); color: var(--text-2); }
.fc-tag.again { background: var(--err-soft); color: var(--err); }
.fc-tag.known { background: var(--ok-soft); color: var(--ok); }
.fc-card { position: relative; perspective: 1400px; cursor: pointer; touch-action: pan-y; border-radius: var(--r-l); outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
.fc-card.fc-enter { animation: fcin .45s var(--ease-spring); }
@keyframes fcin { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.fc-in { display: grid; transform-style: preserve-3d; transition: transform .6s var(--ease-spring); }
.fc-card.flipped .fc-in { transform: rotateY(180deg); }
.fc-face { grid-area: 1 / 1; min-height: 320px; padding: 30px 32px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-m); -webkit-backface-visibility: hidden; backface-visibility: hidden; display: flex; flex-direction: column; gap: 10px; }
.fc-face small { font: 800 12px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.fc-face.front { align-items: center; justify-content: center; text-align: center; background: radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.fc-face.front h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -.02em; max-width: 18ch; }
.fc-src { font: 600 13.5px var(--f-head); color: var(--text-2); }
.fc-hint { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--f-head); color: var(--text-2); opacity: .8; }
.fc-hint svg { width: 17px; height: 17px; color: var(--accent); }
.fc-face.back { transform: rotateY(180deg); border-top: 4px solid var(--accent); }
.fc-def { font: 500 17.5px/1.55 var(--f-body); flex: 1; }
.fc-def i { font-style: italic; }
.fc-card.flipped .front, .fc-card:not(.flipped) .back { pointer-events: none; }
.fc-swipe { position: absolute; top: 16px; z-index: 2; padding: 6px 12px; border-radius: 10px; font: 800 13px var(--f-head); text-transform: uppercase; letter-spacing: .06em; pointer-events: none; opacity: 0; }
.fc-swipe.left { left: 16px; background: var(--err-soft); color: var(--err); border: 2px solid var(--err); opacity: clamp(0, calc(var(--sw, 0) * -1.4), 1); }
.fc-swipe.right { right: 16px; background: var(--ok-soft); color: var(--ok); border: 2px solid var(--ok); opacity: clamp(0, calc(var(--sw, 0) * 1.4), 1); }
.fc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fc-actions .fc-flip { grid-column: 1 / -1; }
.fc-actions .fc-know { background: var(--ok); box-shadow: 0 8px 22px rgba(63, 125, 78, .28); }
:root[data-mode="dark"] .fc-actions .fc-know { color: #10251A; }
.fc-actions .fc-again:hover { border-color: var(--err); }
.fc-keys { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.fc-keys kbd { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); font: 700 12px var(--f-head); color: var(--text); }
.fc-keys kbd:not(:first-child) { margin-left: 8px; }
.fc-keys[hidden] { display: none; }
@media (hover: none) { .fc-keys { display: none; } }
.fc-end { padding: 30px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.fc-end .ic { width: 56px; height: 56px; border-radius: 16px; }
.fc-end .ic svg { width: 28px; height: 28px; }
.fc-end h2 { font-size: 24px; }
.fc-end .cta { justify-content: center; margin-top: 8px; }
.fc-clear { margin-top: 6px; font: 600 13px var(--f-head); color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.fc-clear:hover { color: var(--err); }
@media screen and (max-width: 767px) {
  .fc-face { min-height: 260px; padding: 22px 20px; }
  .fc .gl-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .fc .gl-filters::-webkit-scrollbar { display: none; }
  .fc .gl-f { flex: none; }
  .fc-top { gap: 12px; }
  .fc-stats { margin: 14px 0 10px; gap: 6px 12px; }
  .fc-stats .bar { flex-basis: 100px; }
  .fc-def { font-size: 16px; }
  .fc-end { padding: 22px 18px; }
  .fc-end .cta .btn { width: 100%; }
  .gl-known { top: 14px; right: 14px; }
}

/* ---------- зоны нажатия на сенсорных экранах: не меньше 40–44 px ---------- */
@media (pointer: coarse), screen and (max-width: 767px) {
  .side .nav-item.tool { min-height: 44px; }
  .crumbs a { display: inline-block; padding: 12px 2px; margin: -12px -2px; }
  .diagram .zoom { width: 44px; height: 44px; right: 6px; top: 6px; }
  .gl-f { min-height: 42px; padding: 8px 15px; }
  .gl-abc button { min-width: 40px; height: 40px; }
  .gl-link { padding: 11px 8px; }
  .fc-toggle { min-height: 44px; }
  .fc-keys { display: none; }
}

/* ---------- значения падежей ---------- */
.case-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.case-card { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); display: grid; gap: 6px; }
.case-card small { font: 800 12px var(--f-head); letter-spacing: .08em; text-transform: uppercase; color: var(--ok); }
.case-card b { font: 700 17px/1.35 var(--f-body); font-style: italic; }
.case-card ol { list-style: none; display: grid; gap: 3px; margin: 2px 0 0; padding: 0; }
.case-card li { display: grid; grid-template-columns: 26px minmax(0, 1fr); font-size: 15px; }
.case-card li span { font: 800 14px var(--f-head); color: var(--accent-text); }
.q .case-card { margin-top: 12px; background: var(--ok-soft); border-color: transparent; border-left-color: var(--ok); }
.tabs .tab-ext { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.tabs .tab-ext svg { width: 16px; height: 16px; color: var(--accent); }
a.inl { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
@media screen and (max-width: 767px) {
  .case-cards { grid-template-columns: minmax(0, 1fr); }
  .tabs .tab-ext { margin-left: 0; }
}

/* ---------- сводная таблица частей речи ---------- */
.pos-table .tbl table { font-size: 14.5px; }
.pos-table .tbl th { white-space: nowrap; }
.pos-table tr.grp th { position: static; background: var(--accent-soft); color: var(--accent-text); font: 800 12.5px var(--f-head); letter-spacing: .08em; text-transform: uppercase; padding: 9px 14px; }
.pos-table td:first-child { width: 15%; }
.pos-name { display: inline-flex; align-items: flex-start; gap: 6px; font: 800 15px/1.3 var(--f-head); color: var(--text); }
.pos-name svg { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); flex: none; transition: transform .2s; }
.pos-name:hover { color: var(--accent-text); }
.pos-name:hover svg { transform: translateX(3px); }
.pos-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.pos-foot .muted { font-size: 14px; }
@media screen and (max-width: 767px) {
  .pos-table tr.grp { display: block; background: none; border: 0; box-shadow: none; padding: 14px 2px 4px; margin: 0; }
  .pos-table tr.grp th { display: block; background: none; padding: 0; }
  .pos-table td:first-child { width: auto; }
  .pos-table td:first-child::before { display: none; }
  .pos-table td:first-child { display: block; padding-bottom: 4px; }
  .pos-name { font-size: 16.5px; }
  .pos-foot .btn { width: 100%; }
}
@media print {
  .pos-table .tbl table { font-size: 9.5pt !important; }
  .pos-table .pos-name svg, .pos-foot { display: none !important; }
  .pos-table tr { break-inside: avoid; }
}

/* ---------- общий поиск ---------- */
.srch { position: fixed; inset: 0; z-index: 130; display: none; }
.srch.open { display: block; }
.srch-scrim { position: absolute; inset: 0; background: rgba(28, 18, 10, .38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: srchfade .2s ease; }
:root[data-mode="dark"] .srch-scrim { background: rgba(0, 0, 0, .55); }
.srch-panel { position: relative; margin: min(12vh, 110px) auto 0; width: min(680px, calc(100% - 32px)); max-height: min(72vh, 680px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 30px 80px rgba(20, 12, 6, .32); overflow: hidden; animation: srchin .32s var(--ease-spring); }
@keyframes srchin { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes srchfade { from { opacity: 0; } to { opacity: 1; } }
.srch-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.srch-top > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.srch-top input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--text); font: 600 18px var(--f-body); padding: 6px 0; -webkit-appearance: none; appearance: none; }
.srch-top input::-webkit-search-cancel-button { display: none; }
.srch-top input::placeholder { color: var(--text-2); opacity: .8; }
.srch-x { flex: none; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-strong); font: 700 12px var(--f-head); color: var(--text-2); }
.srch-x:hover { color: var(--text); border-color: var(--accent); }
.srch-list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.srch-hint { padding: 18px 12px; font-size: 15px; color: var(--text-2); line-height: 1.6; }
.srch-hint button { color: var(--accent-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.srch-g { padding: 4px 0 8px; }
.srch-gt { display: block; padding: 8px 10px 6px; font: 800 11.5px var(--f-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.srch-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border-radius: 12px; color: var(--text); }
.srch-item[aria-selected="true"] { background: var(--accent-soft); }
.srch-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.srch-ic svg { width: 17px; height: 17px; }
.srch-item[aria-selected="true"] .srch-ic { background: var(--accent-btn); color: var(--on-accent); }
.srch-tx { display: grid; gap: 2px; min-width: 0; }
.srch-tx b { font: 700 15.5px/1.35 var(--f-head); }
.srch-tx small { font-size: 13.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.srch-tx small.srch-where { font: 700 12px var(--f-head); color: var(--accent-text); -webkit-line-clamp: 1; }
.srch mark { background: var(--warn-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.srch-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.srch-foot kbd { padding: 1px 6px; margin-right: 4px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; font: 700 11.5px var(--f-head); color: var(--text); background: var(--surface); }
html.srch-open { overflow: hidden; }
/* лупа вверху страницы — только на телефоне */
.srch-fab { display: none; }
@media screen and (max-width: 767px) {
  .srch-fab { display: grid; place-items: center; position: fixed; z-index: 35; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; width: 44px; height: 44px; border-radius: 50%; background: var(--panel); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line-strong); box-shadow: var(--shadow-m); color: var(--accent-text); transition: transform .3s var(--ease-out), opacity .25s; }
  .srch-fab svg { width: 21px; height: 21px; }
  .srch-fab.hide { transform: translateY(-70px); opacity: 0; pointer-events: none; }
  .srch-panel { margin: 0; width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .srch-top { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; }
  .srch-top input { font-size: 17px; }
  .srch-x { min-height: 40px; padding: 8px 12px; }
  .srch-foot { display: none; }
  .srch-item { padding: 11px 8px; }
  .page { padding-top: 16px; }
}
@media print { .srch, .srch-fab { display: none !important; } }
@media screen and (max-width: 767px) {
  .page-head > .label, .page-head > h1, .crumbs { padding-right: 52px; }
}
@media (pointer: coarse), screen and (max-width: 767px) {
  .pos-name { padding: 11px 0; margin: -11px 0; }
}
/* сводная таблица на планшете: столбцы фиксированной ширины, текст переносится, без прокрутки вбок */
@media screen and (min-width: 1024px) {
  .pos-table table { table-layout: fixed; }
  .pos-table th:nth-child(1) { width: 15%; } .pos-table th:nth-child(2) { width: 18%; } .pos-table th:nth-child(3) { width: 24%; }
  .pos-table th:nth-child(4) { width: 23%; } .pos-table th:nth-child(5) { width: 20%; }
  .pos-table tr.grp th { width: auto; }
  .pos-table td { overflow-wrap: break-word; }
}
@media screen and (min-width: 1024px) and (max-width: 1100px) {
  .pos-table .tbl table { font-size: 13.5px; }
  .pos-table .tbl th, .pos-table .tbl td { padding: 9px 10px; }
  .pos-name { font-size: 14px; }
  .pos-table .tbl th { white-space: normal; }
}
.scheme-card .link { display: block; line-height: 1.5; }
.scheme-card .link b, .scheme-card .link .nw { white-space: nowrap; }
.scheme-card .link svg { display: inline-block; vertical-align: -3px; margin-left: 4px; }

/* сводная таблица на планшете — карточками, как на телефоне */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .pos-table .tbl.cards { overflow: visible; background: none; border: 0; box-shadow: none; }
  .pos-table .tbl.cards table, .pos-table .tbl.cards tbody, .pos-table .tbl.cards tr, .pos-table .tbl.cards td { display: block; }
  .pos-table .tbl.cards thead { display: none; }
  .pos-table .tbl.cards tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-s); padding: 8px 0; margin-bottom: 10px; }
  .pos-table .tbl.cards td { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 7px 16px; border: 0; }
  .pos-table .tbl.cards td::before { content: attr(data-h); font: 700 12.5px/1.5 var(--f-head); color: var(--text-2); }
  .pos-table .tbl.cards td:first-child { display: block; padding-bottom: 4px; }
  .pos-table .tbl.cards td:first-child::before { display: none; }
  .pos-table .tbl.cards tr.grp { display: block; background: none; border: 0; box-shadow: none; padding: 14px 2px 4px; margin: 0; }
  .pos-table tr.grp th { display: block; background: none; padding: 0; }
  .pos-table td:first-child { width: auto; }
  .pos-name { font-size: 17px; }
}

/* ---------- окно с пояснением ---------- */
.notice { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 16px; }
.notice-scrim { position: absolute; inset: 0; background: rgba(28, 18, 10, .42); animation: srchfade .2s ease; }
:root[data-mode="dark"] .notice-scrim { background: rgba(0, 0, 0, .6); }
.notice-box { position: relative; width: min(460px, 100%); padding: 24px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(20, 12, 6, .32); display: grid; gap: 12px; animation: srchin .32s var(--ease-spring); }
.notice-box h3 { font-size: 20px; }
.notice-tx { display: grid; gap: 8px; font-size: 15.5px; line-height: 1.55; color: var(--text-2); }
.notice-tx b { color: var(--text); }
.notice-box .btn { justify-self: start; margin-top: 4px; }
@media print { .notice { display: none !important; } }
