/* Оболочка: шапка, меню аккаунта, тема, палитра команд, подвал. Поверх app.css, тот же стиль «ведомость». */
:root { --ok: #1a7f4b; --ok-soft: #e9f5ee; --shadow: 0 1px 2px rgba(17,17,17,.06), 0 12px 32px -12px rgba(17,17,17,.22); --header-h: 56px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #5fd39a; --ok-soft: #15291f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7); } }
:root[data-theme="dark"] { --ok: #5fd39a; --ok-soft: #15291f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 16px 40px -12px rgba(0,0,0,.7); }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; }
main.wrap { flex: 1 0 auto; width: 100%; }
::selection { background: var(--accent-fill, var(--accent)); color: var(--on-accent); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ——— Шапка (REDESIGN §3.1): одна строка 56 px ———
   Слева знак, «Трамплин» и вуз; за ними вкладки роли; справа поиск Ctrl K, колокольчик и аватар.
   Наверху страницы шапка того же цвета, что фон; при прокрутке — полупрозрачная с размытием и линией снизу
   (класс is-scrolled ставит shell.js). Текущая вкладка — подложка выбранного сегмента (--seg-on) и золотая
   черта 2 px по нижнему краю шапки; при переходе черта переезжает к новой вкладке (View Transitions, theme.css).
   Вкладки, которым не хватило места (узкий экран, казахские подписи), shell.js переносит в «Ещё ▾». */
header.bar { position: sticky; top: 0; z-index: 45; background: var(--bg); border-bottom: 0; box-shadow: inset 0 -1px 0 transparent;
  transition: background-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
header.bar.is-scrolled { background: color-mix(in srgb, var(--bg) 76%, transparent); box-shadow: inset 0 -1px 0 var(--line);
  -webkit-backdrop-filter: saturate(1.8) blur(14px); backdrop-filter: saturate(1.8) blur(14px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { header.bar.is-scrolled { background: var(--bg); } }
header.bar .wrap { position: relative; display: flex; align-items: center; flex-wrap: nowrap; gap: 0 4px; height: var(--header-h); min-height: 0; padding-block: 0; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; min-width: 0; height: 40px; margin-right: 14px; color: var(--ink); text-decoration: none; border-radius: var(--r-s); }
.brand .mark { width: 28px; height: 28px; flex: none; color: var(--ink); }
.brand b { font: 800 19px/1 var(--f-display); letter-spacing: -.035em; white-space: nowrap; }
.brand span { display: inline-flex; align-items: center; gap: 12px; font: 550 13px/1 var(--f-body); color: var(--muted); white-space: nowrap; }
.brand span::before { content: ""; width: 1px; height: 18px; background: var(--field); transform: skewX(-18deg); }
.brand:hover span { color: var(--ink); }
.brand .uni-logo { height: 20px; width: auto; margin: 0 2px; }

/* Вкладки */
nav.tabs { display: flex; flex-wrap: nowrap; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; }
/* По горизонтали лишнее обрезается (его заберёт «Ещё»), по вертикали меню «Ещё» выпадает свободно */
.js nav.tabs:not(.guest) { overflow-x: clip; overflow-y: visible; }
html:not(.js) nav.tabs:not(.guest) { overflow-x: auto; scrollbar-width: none; }
nav.tabs > a, .nav-more > summary { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 10px; margin: 0;
  border: 0; border-radius: var(--r-s); color: var(--muted); font: 550 14px/1 var(--f-body); letter-spacing: -.005em; white-space: nowrap; text-decoration: none;
  transition: color var(--t-quick) var(--ease-out), background-color var(--t-quick) var(--ease-out), box-shadow var(--t-quick) var(--ease-out); }
nav.tabs > a:hover, .nav-more > summary:hover, .nav-more[open] > summary { color: var(--ink); background: var(--hover); }
nav.tabs > a[aria-current="page"], .nav-more > summary[aria-current="page"] { color: var(--ink); background: var(--seg-on); box-shadow: var(--seg-shadow), 0 0 0 1px var(--line); }
nav.tabs > a.is-over { display: none; }
/* Текущая вкладка уехала в «Ещё»: подсвечено «Ещё» */
.nav-more > summary.has-over-current { color: var(--ink); background: var(--seg-on); box-shadow: var(--seg-shadow), 0 0 0 1px var(--line); }
.nav-more > summary.has-over-current::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: calc((34px - var(--header-h)) / 2); height: 2px; border-radius: 2px 2px 0 0; background: var(--gold); }
/* Золотая черта текущей вкладки — по нижнему краю шапки */
.tab-mark { position: absolute; left: 10px; right: 10px; bottom: calc((34px - var(--header-h)) / 2); height: 2px; border-radius: 2px 2px 0 0; background: var(--gold); pointer-events: none; }
/* Счётчики — число на --accent-fill (точка — у колокольчика и в «Ещё») */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px;
  background: var(--accent-fill); color: var(--on-accent); font: 650 11px/1 var(--f-body); letter-spacing: 0; font-variant-numeric: tabular-nums; }
nav.tabs .badge, .nav-more .badge { margin: 0; }
.dot-badge { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-fill); flex: none; }

/* «Ещё ▾»: меню вуза и вкладки, которым не хватило места */
.nav-more { position: relative; display: flex; align-items: center; flex: none; }
.nav-more[hidden] { display: none; }
.nav-more > summary { list-style: none; cursor: pointer; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary svg { transition: transform var(--t-base) var(--ease-out); }
.nav-more[open] > summary svg { transform: rotate(180deg); }
.more-over:empty { display: none; }
.more-over:not(:empty) + a { margin-top: 5px; position: relative; }
.more-over:not(:empty) + a::before { content: ""; position: absolute; left: 4px; right: 4px; top: -3px; height: 1px; background: var(--line); }

/* Выпадающие меню шапки: одна поверхность, появляются сдвигом на 4 px */
.more-menu, .account-menu, .bell-menu { position: absolute; z-index: 50; top: calc(100% + 10px); display: flex; flex-direction: column; padding: 6px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow); transform-origin: top right; }
/* «Ещё» — последний пункт вкладок, а вкладки обрезаны по горизонтали (overflow-x: clip): меню открывается влево от правого края
   «Ещё», внутрь полосы вкладок, иначе его правая часть уходит под обрезку. По вертикали выпадает свободно. */
.more-menu { left: auto; right: 0; min-width: 240px; max-width: calc(100vw - 24px); transform-origin: top right; }
details[open] > :is(.more-menu, .account-menu, .bell-menu, .pop-menu) { animation: menu-in var(--t-base) var(--ease-out) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.more-menu a, .account-menu a, .account-menu .link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink);
  text-decoration: none; font-size: var(--fs-small); font-weight: 500; white-space: nowrap; text-align: left; width: 100%; box-sizing: border-box;
  transition: background-color var(--t-quick) var(--ease-out); }
.more-menu a:hover, .account-menu a:hover, .account-menu .link:hover { background: var(--hover); }
.more-menu a[aria-current="page"], .account-menu a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.more-menu .badge { margin-left: auto; }

/* Справа: поиск, колокольчик, аватар */
.user-menu { display: flex; align-items: center; gap: 4px; flex: none; margin-left: auto; padding-left: 8px; }
.icon-btn { position: relative; width: 36px; height: 36px; min-height: 0; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-s);
  background: none; color: var(--muted); transition: color var(--t-quick) var(--ease-out), background-color var(--t-quick) var(--ease-out); }
.icon-btn:hover, details[open] > .icon-btn { color: var(--ink); background: var(--hover); }
.search-btn { display: inline-flex; align-items: center; gap: 8px; width: 188px; height: 34px; min-height: 0; margin-right: 6px; padding: 0 5px 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--muted); font: 500 13.5px/1 var(--f-body); box-shadow: var(--lift);
  transition: border-color var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out); }
.search-btn svg { width: 16px; height: 16px; }
.search-btn span { flex: 1; text-align: left; }
.search-btn:hover { color: var(--ink); border-color: var(--field); }
.search-btn kbd { font-size: 11px; }
kbd { font: 500 11px var(--f-code); color: var(--muted); border: 1px solid var(--line); background: var(--bg); padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
[data-theme-toggle] .moon { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [data-theme-toggle] .sun { display: none; } :root:not([data-theme="light"]) [data-theme-toggle] .moon { display: block; } }

/* Колокольчик: число — на --accent-fill с кольцом цвета шапки */
.bell { position: relative; }
.bell > summary, .account > summary { list-style: none; cursor: pointer; }
.bell > summary::-webkit-details-marker, .account > summary::-webkit-details-marker { display: none; }
.bell-dot { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px;
  background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 0 0 2px var(--bg); font: 650 10px/16px var(--f-body); text-align: center; font-variant-numeric: tabular-nums; }
.bell-menu { right: -44px; width: min(380px, calc(100vw - 24px)); padding: 0; overflow: hidden; }
.bell-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-list { list-style: none; margin: 0; padding: 4px; max-height: 420px; overflow-y: auto; }
.bell-list a { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 2px 12px; padding: 10px 12px; border-radius: var(--r-s); color: var(--ink); text-decoration: none;
  transition: background-color var(--t-quick) var(--ease-out); }
.bell-list a:hover { background: var(--hover); }
.bell-list a i { grid-row: span 2; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--accent); }
.bell-list a i.k-offer, .bell-list a i.k-soon { background: var(--ok); }
.bell-list a i.k-test, .bell-list a i.k-verify, .bell-list a i.k-interview { background: var(--warn); }
.bell-list b { font-weight: 550; font-size: 14px; }
.bell-list small { color: var(--muted); font-size: 12px; }
.bell-empty { padding: 24px 16px; color: var(--muted); font-size: 14px; }

/* Аккаунт */
.account { position: relative; }
.account > summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.account-menu { right: 0; width: 268px; }
.account-menu .link { color: var(--warn); border: 0; background: none; min-height: 0; font: inherit; font-size: var(--fs-small); font-weight: 500; cursor: pointer; }
.account-menu form { border-top: 1px solid var(--line); margin: 6px 0 0; padding-top: 6px; }
.account-who { display: flex; align-items: center; gap: 12px; padding: 8px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.account-who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-who-text b { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-who .code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-chip { align-self: flex-start; margin-top: 4px; font: 600 12px var(--f-body); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.account-prefs { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 10px; font-size: var(--fs-small); color: var(--muted); }
.account-prefs:first-of-type { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.theme-btn { width: auto; padding: 0 12px; gap: 8px; display: inline-flex; align-items: center; border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; min-height: 32px; height: 32px; border-radius: var(--r-s); background: var(--surface); }
.theme-btn span { font-weight: 550; }

/* Гость */
.link-quiet { color: var(--ink); text-decoration: none; font-weight: 550; font-size: 14px; padding: 0 10px; height: 34px; display: inline-flex; align-items: center; border-radius: var(--r-s); transition: background-color var(--t-quick) var(--ease-out); }
.link-quiet:hover { background: var(--hover); color: var(--ink); }
.btn.small, a.btn.small { min-height: 34px; height: 34px; padding: 0 14px; font-size: 14px; border-radius: var(--r-s); }
.bar-lang { display: contents; }
.nav-toggle { display: none; }
.nav-prefs { display: none; }

/* Тесно: сначала поиск сжимается до «🔍 Ctrl K», потом уходит название вуза, потом поиск становится значком */
@media (max-width: 1499px) { .search-btn { width: auto; padding: 0 5px 0 9px; } .search-btn span { display: none; } }
@media (max-width: 1280px) { .brand span { display: none; } }
@media (max-width: 1180px) {
  .search-btn { width: 36px; height: 36px; margin-right: 0; padding: 0; justify-content: center; border-color: transparent; background: none; box-shadow: none; }
  .search-btn:hover { background: var(--hover); border-color: transparent; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn svg { width: 20px; height: 20px; }
}
/* Гость на узком экране: разделы — кнопкой меню, панелью под шапкой */
@media (max-width: 980px) {
  header.bar:has(nav.tabs.guest) .nav-toggle { display: inline-grid; margin-left: -8px; }
  nav.tabs.guest { position: absolute; left: 0; right: 0; top: 100%; height: auto; display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 8px max(16px, env(safe-area-inset-left, 0px)) 16px; background: var(--bg); box-shadow: inset 0 1px 0 var(--line), 0 16px 32px -24px var(--scrim); }
  nav.tabs.guest.open { display: flex; animation: menu-in var(--t-base) var(--ease-out) both; }
  nav.tabs.guest > a { height: 44px; padding: 0 12px; font-size: 15px; }
  nav.tabs.guest > a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
  nav.tabs.guest .tab-mark { display: none; }
  nav.tabs.guest.open .nav-prefs { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 0; margin-top: 6px; border-top: 1px solid var(--line); }
  header.bar .bar-lang, header.bar .bar-theme { display: none; }
}
/* Телефон, вошедший: разделы — в нижней панели (core/_bottom_bar.html) */
@media (max-width: 760px) {
  nav.tabs:not(.guest) { display: none; }
  .brand { margin-right: auto; }
  .brand b { font-size: 18px; }
  .user-menu { padding-left: 0; gap: 2px; }
  .bell-menu { position: fixed; left: 12px; right: 12px; top: calc(var(--header-h) + 4px); width: auto; }
}
@media (max-width: 420px) { header.bar .link-quiet { padding: 0 6px; } header.bar:has(nav.tabs.guest) .user-menu { gap: 2px; } }

/* ——— Нижняя панель на телефоне (core/_bottom_bar.html, REDESIGN §3.1) ———
   До 760 px вкладки шапки уходят вниз, под большой палец: четыре главных раздела роли и «Ещё» со шторкой.
   Цель касания — от 44 × 44, подпись под значком, текущий раздел — акцентом и золотой точкой (точка переезжает
   между страницами, theme.css). Прячется при прокрутке вниз, возвращается при прокрутке вверх (shell.js).
   Что лежит у низа экрана, поднимается на --tabbar-offset: высота панели, пока она видна, иначе 0. */
:root { --tabbar-h: 58px; --tabbar-offset: 0px; }
.tabbar, .tb-sheet:not([open]) { display: none; }
@media (max-width: 760px) {
  body.has-tabbar { --tabbar-offset: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar.tb-down { --tabbar-offset: 0px; }
  .has-tabbar .tabbar { position: fixed; z-index: 44; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr);
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: inset 0 1px 0 var(--line);
    -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
    transition: transform var(--t-move) var(--ease-out); }
  .has-tabbar.tb-down .tabbar { transform: translateY(calc(100% + 1px)); }
  .tabbar > a, .tabbar > button { position: relative; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 44px; min-height: 44px; height: var(--tabbar-h); margin: 0; padding: 6px 2px 5px; border: 0; border-radius: 0; background: none; box-shadow: none;
    color: var(--muted); font: 600 11px/1.1 var(--f-body); letter-spacing: 0; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color var(--t-quick) var(--ease-out); }
  .tabbar > :is(a, button):hover { color: var(--ink); border: 0; background: none; }
  .tabbar > :is(a[aria-current="page"], button[aria-current="true"]) { color: var(--accent); }
  .tb-ic { position: relative; display: grid; place-items: center; width: 48px; height: 28px; border-radius: 999px; transition: background-color var(--t-quick) var(--ease-out), transform var(--t-quick) var(--ease-out); }
  .tabbar > :is(a, button):active .tb-ic { transform: scale(.92); background: var(--hover); }
  .tb-t { max-width: 100%; white-space: nowrap; }
  html[lang="kk"] .tb-t { font-size: 10.5px; letter-spacing: -.01em; }  /* казахские подписи длиннее */
  .tb-dot { position: absolute; top: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
  .tb-badge { position: absolute; top: -2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px;
    background: var(--accent-fill); color: var(--on-accent); box-shadow: 0 0 0 2px var(--bg); font: 650 10px/16px var(--f-body); text-align: center; font-variant-numeric: tabular-nums; }
  .tb-badge-dot { min-width: 8px; width: 8px; height: 8px; padding: 0; top: 2px; left: calc(50% + 8px); }
  /* Свой низ у страницы: холст (шторка студии), переписка на весь экран, документ — панели нет */
  body.has-tabbar:is(.no-tabbar, .layout-workspace, .has-thread, .doc-frame) { --tabbar-offset: 0px; padding-bottom: 0; }
  body:is(.no-tabbar, .layout-workspace, .has-thread, .doc-frame) .tabbar { display: none; }
}

/* «Ещё» — шторка снизу со всеми разделами роли */
.tb-sheet[open] { position: fixed; inset: auto 0 0 0; z-index: 80; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; max-width: none;
  max-height: min(82vh, 680px); margin: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); overflow: auto; overscroll-behavior: contain;
  border: 0; border-radius: 22px 22px 0 0; background: var(--raised); color: var(--ink); box-shadow: var(--shadow), 0 -1px 0 var(--line);
  animation: sheet-in var(--t-move) var(--ease-spring) both; }
.tb-sheet:focus { outline: 0; }
.tb-sheet.is-closing { animation: sheet-out var(--t-base) var(--ease-out) both; }
.tb-sheet::backdrop { background: var(--scrim); animation: fade-in var(--t-base) var(--ease-out) both; }
.tb-sheet.is-closing::backdrop { animation: fade-out var(--t-base) var(--ease-out) both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.tb-sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 4px 8px 8px; background: var(--raised); }
.tb-grip { position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 999px; background: var(--field); }
.tb-sheet h2 { margin: 0; font: 700 var(--fs-sub)/1.2 var(--f-body); letter-spacing: -.01em; }
.tb-group { margin: 14px 8px 4px; font: 600 var(--fs-caption)/1.3 var(--f-body); color: var(--muted); letter-spacing: .02em; }
.tb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-list a { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 12px; border-radius: var(--r-m); color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 550; transition: background-color var(--t-quick) var(--ease-out); }
.tb-list a > span:first-of-type { flex: 1; min-width: 0; }
.tb-list a:hover, .tb-list a:active { background: var(--hover); }
.tb-list a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tb-list .tb-i { color: var(--muted); }
.tb-list a[aria-current="page"] .tb-i { color: var(--accent); }

/* Сообщения */
.messages li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-left: 3px solid var(--field); animation: msg-in var(--t-move) var(--ease-out); }
.messages li.success { border-left-color: var(--accent); }
.messages li.error { border-left-color: var(--warn); }
.msg-x { border: 0; background: none; min-height: 0; padding: 0 2px; line-height: 1; color: var(--muted); display: inline-grid; place-items: center; }
@keyframes msg-in { from { opacity: 0; transform: translateY(-6px); } }

/* Палитра команд */
.palette { border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 32px)); margin: 12vh auto auto; max-height: 70vh; overflow: visible; }
.palette::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.palette-box { background: var(--bg); color: var(--ink); border-top: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: 70vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { color: var(--muted); flex: none; }
.palette-input input { border: 0 !important; outline: none !important; font-size: 17px; min-height: 56px; padding: 0; background: none; }
.palette-list { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.palette-list .grp { padding: 10px 16px 4px; font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.palette-list a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; color: var(--ink); text-decoration: none; font-size: 15px; }
.palette-list a small { color: var(--muted); font-size: 12px; font-family: var(--f-mono); white-space: nowrap; }
.palette-list a[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.palette-list mark { background: none; color: var(--accent); font-weight: 600; }
.palette-list .none { padding: 16px; color: var(--muted); font-size: 14px; }
.palette-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11px; }

/* ——— Подвал ———
   Вошедшему — одна тихая строка (знак, вуз, пять ссылок): рабочее уже в шапке и нижней панели.
   Гостю — полный: о платформе, помощь, с чего начать, правовая строка. У Холста, Мессенджера и Фокуса подвала нет. */
.foot-site { margin-top: 48px; padding: 0 0 env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.foot-site a { color: var(--muted); text-decoration: none; }
.foot-site a:hover { color: var(--ink); }
.foot-mark { width: 18px; height: 18px; flex: none; color: var(--faint); }
.foot-line .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 28px; min-height: 56px; padding-block: 14px; box-sizing: border-box; }
.foot-sign { display: flex; align-items: center; gap: 10px; margin: 0; font-variant-numeric: tabular-nums; }
.foot-line nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot-line nav a { font-size: var(--fs-small); }

.foot-full { padding-top: 48px; background: var(--surface); }
.foot-full .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 40px 64px; padding-bottom: 28px; }
.foot-brand { display: flex; flex-direction: column; gap: 10px; }
.foot-logo { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; color: var(--ink) !important; }
.foot-logo .foot-mark { width: 26px; height: 26px; color: var(--ink); }
.foot-logo b { font: 800 19px/1 var(--f-display); letter-spacing: -.035em; }
.foot-brand p { margin: 0; max-width: 38ch; font-size: 14.5px; line-height: 1.55; }
.foot-uni { font-size: var(--fs-small) !important; color: var(--faint); }
.foot-full nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-full nav div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.foot-full nav h3 { margin: 0 0 4px; font: 650 var(--fs-small)/1.3 var(--f-body); letter-spacing: 0; text-transform: none; color: var(--ink); }
.foot-full nav a { font-size: 14.5px; }
.foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--fs-caption); color: var(--muted); }
.foot-legal span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 10px 2px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
@media (max-width: 760px) {
  .foot-site { margin-top: 32px; }
  .foot-full { padding-top: 32px; }
  .foot-full .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .foot-full nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-line .wrap { flex-direction: column; align-items: flex-start; gap: 10px; padding-block: 18px; }
  .foot-line nav { gap: 6px 18px; }
  .foot-legal { flex-direction: column; gap: 6px; }
  .foot-legal span + span::before { display: none; }
}

/* Общие мелочи, которыми пользуются новые страницы */
.eyebrow { font: 500 12px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow.accent { color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.accent { color: var(--accent); border-color: currentColor; }
.tag.ok { color: var(--ok); border-color: currentColor; }
.tag.warn { color: var(--warn); border-color: currentColor; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; }
.ticks li { padding-left: 24px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 10px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* ——— Движение интерфейса (REDESIGN §3.5): токены theme.css, анимируются цвет, тень, transform и opacity ———
   Наведение и нажатие — --t-quick; меню, подсказки, раскрытие — --t-base; шторки и панели — --t-move. */
a { transition: color var(--t-quick) var(--ease-out), background-color var(--t-quick) var(--ease-out), text-decoration-color var(--t-quick) var(--ease-out); }
button, .btn, a.btn, summary.btn { transition: background-color var(--t-quick) var(--ease-out), border-color var(--t-quick) var(--ease-out),
  color var(--t-quick) var(--ease-out), box-shadow var(--t-quick) var(--ease-out), transform var(--t-quick) var(--ease-out); }
/* Нажатие — одно на сайт: кнопка проседает на 1 px */
button:active:not(:disabled), a.btn:active, summary.btn:active { transform: translateY(1px); }
input, select, textarea { transition: border-color var(--t-quick) var(--ease-out), background-color var(--t-quick) var(--ease-out), box-shadow var(--t-quick) var(--ease-out); }
/* Рамка фокуса не возникает рывком: кольцо поля проявляется, кольцо кнопки и ссылки раскрывается до отступа 2 px */
input:focus, select:focus, textarea:focus { animation: field-ring var(--t-base) var(--ease-out); }
:is(a, button, summary, [tabindex]:not([tabindex="-1"]), .btn):focus-visible { animation: focus-ring var(--t-quick) var(--ease-out); }
@keyframes field-ring { from { outline-color: transparent; } }
@keyframes focus-ring { from { outline-offset: 0; outline-color: transparent; } }
.w, .card { transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
.card:hover { border-top-color: var(--accent); }
.list button, .thread-row, .palette-list a { transition: background-color var(--t-quick) var(--ease-out); }
/* Палитра Ctrl K и диалоги: проявляются со сдвигом 4 px, фон темнеет */
.palette[open] .palette-box, .overlay:not([hidden]) > .modal { animation: menu-in var(--t-base) var(--ease-out) both; }
.palette[open]::backdrop { animation: fade-in var(--t-base) var(--ease-out) both; }

@media print { header.bar, .foot-site, .palette, .skip, .tabbar, .tb-sheet { display: none !important; } body.has-tabbar { padding-bottom: 0 !important; } }

/* Виджет «Первые шаги» */
.start-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 32px; align-items: end; }
.start-head .meter { margin-bottom: 8px; }
@media (max-width: 640px) { .start-head { grid-template-columns: minmax(0, 1fr); } }
.start-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border-top: 1px solid var(--line); }
.start-steps li a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 14px 0; height: 100%; box-sizing: border-box; color: var(--ink); text-decoration: none; }
.start-steps li + li a { padding-left: 16px; border-left: 1px solid var(--line); }
.start-steps li a:hover b { color: var(--accent); }
.start-steps b { font-weight: 600; font-size: 14.5px; }
.start-steps small { color: var(--muted); font-size: 12.5px; }
.start-steps .tick { width: 18px; height: 18px; border: 1.5px solid var(--field); margin-bottom: 6px; position: relative; }
.start-steps .done .tick { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); }
.start-steps .done .tick::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.start-steps .done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--field); }
@media (max-width: 640px) { .start-steps li + li a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } }
.w > .w-foot { margin-top: auto; }

/* Вход и регистрация */
.page-auth main.wrap { padding-top: 24px; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 80px; align-items: start; }
.auth-main { display: flex; flex-direction: column; gap: 16px; max-width: 480px; padding-block: 24px; }
.auth-main h1 { font-size: clamp(36px, 4vw, 52px); }
.auth-main .lead { margin: 0; }
.auth-main .stack { max-width: none; }
.wide-btn { width: 100%; min-height: 50px; font-size: 15px; }
.label-link { float: right; font-size: 13px; }
.auth-main label { display: block; }
.pw { position: relative; }
.pw input { padding-right: 96px; }
.pw-eye { position: absolute; right: 4px; top: 4px; bottom: 4px; min-height: 0; border: 0; background: none; color: var(--muted); font-size: 13px; padding: 0 10px; }
.pw-eye:hover { color: var(--ink); }
.auth-error { margin: 0; padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; border-left: 3px solid var(--warn); }
.auth-alt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.auth-alt span { margin-right: 8px; }
.auth-alt-line { margin: 0; font-size: 14px; }
.auth-roles { gap: 0 24px; }
.auth-roles a { padding: 8px 0; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.auth-roles a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.auth-aside { position: sticky; top: calc(var(--header-h) + 24px); min-height: min(600px, calc(100vh - 120px)); box-sizing: border-box; background: var(--ink); color: var(--bg); padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; gap: 20px; position: relative; overflow: hidden; }
.auth-aside .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.auth-quote { margin: 0; font: 800 clamp(26px, 2.6vw, 36px)/1.1 var(--f-display); letter-spacing: -.03em; max-width: 18ch; }
.auth-aside .ticks { opacity: .85; }
.auth-aside .ticks li::before { border-color: var(--bg); }
.auth-mini { margin-top: auto; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); border-top: 2px solid var(--accent); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); transform: translateX(12%) rotate(-1.5deg); }
.auth-mini div { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 0 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.auth-mini b { grid-row: span 2; font: 800 38px/1 var(--f-display); letter-spacing: -.04em; color: var(--accent); align-self: center; }
.auth-mini div + div b { color: var(--ink); }
.auth-mini span { font-weight: 600; font-size: 15px; }
.auth-mini small { font: 12px var(--f-mono); color: var(--muted); }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } }
.auth-main .stack .helptext ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.auth-main .stack div:has(> input[type=password]) { gap: 6px; }

/* Вакансии: фильтры и карточки */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.filters { display: flex; flex-direction: column; gap: 14px; }
.filters .kinds button { font-size: 15px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row > label { flex: 0 1 auto; }
.filter-row select { width: auto; min-width: 150px; }
.f-search { flex: 1 1 320px !important; position: relative; }
.f-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.f-search input { padding-left: 38px !important; }
.f-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); font-size: 14px; cursor: pointer; }
.f-check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.f-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.f-summary { margin: 0; font-size: 12px; }
/* Город, зарплата, порядок и флажки: на широком экране — в строке фильтров, на телефоне — под «Фильтры ▾» */
.f-extra { display: contents; }
.cards > .promo-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--muted); }
.f-toggle { display: none; }
@media (max-width: 640px) {
  .filters { gap: 10px; }
  .filters .kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .filters .kinds button { flex: none; white-space: nowrap; }
  .js .f-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; flex: none; }
  .js .filters:not(.f-open) .f-extra { display: none; }
  .js .filters.f-open .f-extra { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .filter-row .f-search { flex: 1 1 0 !important; min-width: 0; }
}
.js .f-go { display: none; }
.js .f-search:focus-within ~ .f-go { display: inline-flex; }
.meta-right { display: inline-flex; gap: 8px; align-items: center; }
.card { position: relative; }
.card-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title h2 { flex: 1; min-width: 0; }
.card-title a.stretched { color: inherit; text-decoration: none; }
.card-title a.stretched::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card-score { font: 800 30px/1 var(--f-display); letter-spacing: -.03em; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-score small { font-size: 14px; font-weight: 600; margin-left: 1px; }
.card-score.top { color: var(--accent); }
.card .foot { position: relative; z-index: 1; }
.card .foot a, .card .save-form { position: relative; z-index: 1; }
.card.boosted { border-top-color: var(--accent); }
.reqs-row { flex: none !important; flex-direction: row !important; flex-wrap: wrap; gap: 4px 14px !important; }
.save-form { margin: 0; }
.save-btn { width: 38px; height: 38px; min-height: 0; padding: 0; display: grid; place-items: center; border-color: var(--line); }
.save-btn svg { color: var(--muted); }
.save-btn[aria-pressed="true"] { border-color: var(--accent); }
.save-btn[aria-pressed="true"] svg { color: var(--accent); fill: currentColor; }
.empty-state { grid-column: 1 / -1; border-top: 1px solid var(--line); padding: 40px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.empty-state b { font: 800 26px var(--f-display); letter-spacing: -.02em; }
.empty-state p { margin: 0; color: var(--muted); max-width: 52ch; }
.opp-title { display: flex; justify-content: space-between; gap: 16px 32px; align-items: flex-end; flex-wrap: wrap; }
.opp-side { display: flex; gap: 16px; align-items: center; }
.opp-side .card-score { font-size: 44px; }
.opp-side form { margin: 0; }
.save-btn.wide { width: auto; padding: 0 14px; gap: 8px; display: inline-flex; min-height: 44px; font-size: 14px; }

/* Переключатель языка */
.lang-switch { display: inline-flex; margin: 0; border: 1px solid var(--line); }
.lang-switch button { min-height: 34px; padding: 0 9px; border: 0; background: none; color: var(--muted); font: 500 12px var(--f-mono); letter-spacing: .02em; }
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang-switch button:hover:not([aria-pressed="true"]) { color: var(--ink); }
@media (max-width: 420px) { .lang-switch button { padding: 0 7px; } }

.bar-lang { display: contents; }

/* Вуз: логотип в шапке и выбор вуза у суперпользователя (модуль tenancy). */
.brand .uni-logo { height: 20px; width: auto; margin: 0 2px 0 6px; vertical-align: middle; }
.uni-switch { padding: 6px 12px 10px; border-bottom: 1px solid var(--line); }
.uni-switch label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
/* Виды в каталоге вакансий на телефоне переносятся во вторую строку: у пилюль-контейнера скругление поменьше */
@media (max-width: 640px) { .filters .kinds { border-radius: 22px; } }
