/* ===== Новые страницы (редизайн). Цвета — только из токенов темы, поэтому вся кастомизация продолжает работать. ===== */
:root {
  --h-warn: #c98a2b;
  --h-ok: #3f9a6b;
  --h-violet: #8a6bc9;
  --h-info: #4f8fc0;
  --h-gap: 16px;
  --h-quote-font: "Caveat", "Comfortaa", cursive;
  --h-on-hero: #fff;
}

/* Видимость: новые страницы показываются вместо профиля и старых разделов */
.hub-page { position: relative; z-index: calc(var(--layer-content) + 1); display: none; width: min(1240px, calc(100% - 32px)); margin: 150px auto 64px; }
.profile-screen[data-view="hub"] .hub-page { display: block; }
.profile-screen[data-view="hub"] :is(.profile-card, .works-section, .sticker-layer, .frame-page-layer, .avatar-edit.is-floating, .my-works, .home-page, .team-page, #hub-profile) { display: none !important; }
.profile-screen:not([data-view="hub"]) .hub-page { display: none !important; }
html:not(.is-staff) .staff-only { display: none !important; }

/* Шапка сайта */
.topbar a.nav-item, .topbar a.brand { color: inherit; text-decoration: none; }
.topbar .h-bow { display: inline-flex; color: var(--accent); }
.topbar .h-bow svg { width: 30px; height: 20px; }
.h-team-name { font-weight: 800; white-space: nowrap; }
#notif-button { position: relative; }
.h-dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; color: var(--button-text); background: var(--danger); font-size: .62rem; font-weight: 800; line-height: 16px; text-align: center; }
.h-menu-link { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600; }
.h-menu-link:hover { background: var(--accent-weak); }
.h-menu-link svg { width: 18px; height: 18px; color: var(--accent); }
#menu-pop hr, .h-menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); }

/* Заголовок страницы */
.h-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 24px; margin: 0 4px 18px; color: var(--h-on-hero); text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.h-head h1 { margin: 0; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.02; }
.h-sub { margin: 6px 0 0; font-size: 1rem; opacity: .92; }
.h-quote { grid-row: 1 / span 2; grid-column: 2; align-self: start; max-width: 300px; margin: 0; font-family: var(--h-quote-font); font-size: 1.6rem; line-height: 1.05; text-align: right; transform: rotate(-4deg); opacity: .95; }
.h-head-actions { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.h-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: .9rem; opacity: .95; }
.h-crumbs a { color: inherit; font-weight: 600; text-decoration: none; }
.h-crumbs a:hover { text-decoration: underline; }
.h-crumbs span { opacity: .6; }
@media (max-width: 720px) { .h-head { grid-template-columns: 1fr; } .h-quote { display: none; } .h-head-actions { grid-column: 1; justify-content: flex-start; } .hub-page { margin-top: 110px; } }

/* Вкладки страницы — лежат прямо на фоне */
.h-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--h-gap); }
.h-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 18px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--surface-strong) calc(var(--card-alpha, 86%) - 6%), transparent); backdrop-filter: blur(var(--card-blur, 20px)); -webkit-backdrop-filter: blur(var(--card-blur, 20px)); font-weight: 650; text-decoration: none; white-space: nowrap; }
.h-tab svg { width: 17px; height: 17px; }
.h-tab:hover { border-color: var(--accent); }
.h-tab.is-active { color: var(--button-text); border-color: var(--dark); background: var(--dark); }
.h-tabs.is-sticky { position: sticky; top: 8px; z-index: var(--layer-navigation); padding: 6px; margin-left: -6px; margin-right: -6px; border-radius: 999px; }
.h-tabs.is-sticky.is-stuck { background: color-mix(in srgb, var(--surface-strong) 80%, transparent); backdrop-filter: blur(16px); box-shadow: var(--shadow-float); }
@media (max-width: 720px) { .h-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .h-tab { padding: 8px 14px; } }

/* Панель инструментов над содержимым */
.h-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: var(--h-gap); }
.h-toolbar .h-grow { flex: 1 1 auto; }
.h-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.h-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: color-mix(in srgb, var(--surface-strong) var(--card-alpha, 86%), transparent); backdrop-filter: blur(12px); font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; }
.h-chip svg { width: 16px; height: 16px; }
.h-chip:hover { border-color: var(--accent); }
.h-chip.is-active { color: var(--button-text); border-color: var(--dark); background: var(--dark); }
.h-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); font-size: .76rem; font-weight: 750; text-align: center; }
.h-search { display: inline-flex; flex: 0 1 300px; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface-strong) var(--card-alpha, 86%), transparent); backdrop-filter: blur(12px); }
.h-search svg { width: 17px; height: 17px; color: var(--text-muted); }
.h-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; }
.h-select { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 34px 0 14px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface-strong) var(--card-alpha, 86%), transparent); backdrop-filter: blur(12px); color: var(--text); font-weight: 600; }
.h-select > span { color: var(--text-muted); font-size: .85rem; }
.h-select select { appearance: none; border: 0; outline: 0; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.h-select > svg { position: absolute; right: 12px; width: 16px; height: 16px; pointer-events: none; }
.h-select select option { color: var(--text); background: var(--surface-strong); }
.h-seg { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface-strong) var(--card-alpha, 86%), transparent); backdrop-filter: blur(12px); }
.h-seg button { display: grid; place-items: center; width: 34px; height: 32px; border: 0; border-radius: 999px; color: var(--text-muted); background: transparent; cursor: pointer; }
.h-seg button svg { width: 17px; height: 17px; }
.h-seg button.is-active { color: var(--button-text); background: var(--dark); }
.h-icon-btn { display: inline-grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 999px; color: var(--text-muted); background: transparent; cursor: pointer; }
.h-icon-btn:hover { color: var(--text); background: var(--accent-weak); }
.h-icon-btn svg { width: 18px; height: 18px; }
.h-icon-btn.is-on { color: var(--accent); }
.button.h-btn-sm { min-height: 38px; padding: 8px 16px; font-size: .9rem; }
.button.h-btn-xs { min-height: 30px; padding: 4px 12px; font-size: .82rem; gap: 6px; }
.button svg { width: 18px; height: 18px; }
.h-link-btn { padding: 0; border: 0; color: var(--accent); background: none; font: inherit; font-weight: 700; cursor: pointer; }
.h-link { color: var(--accent); font-weight: 700; text-decoration: none; }
.h-link:hover { text-decoration: underline; }
.h-muted { color: var(--text-muted); }

/* Плитки и сетки */
.hub-page .tile { position: relative; }
.h-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.h-tile-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.08rem; font-weight: 750; }
.h-tile-head h2 svg { width: 20px; height: 20px; color: var(--accent); }
.h-grid { display: grid; gap: var(--h-gap); }
.h-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.h-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.h-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .h-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .h-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .h-cols-2, .h-cols-3, .h-cols-4 { grid-template-columns: minmax(0, 1fr); } }

/* Плитки-цифры */
.h-stat { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 18px 20px; color: var(--text); text-decoration: none; }
a.h-stat:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.h-stat-ic { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: var(--accent); background: var(--accent-weak); }
.h-stat-ic svg { width: 24px; height: 24px; }
.h-stat b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.h-stat span { color: var(--text-muted); font-size: .88rem; }
.h-stat small { display: block; color: var(--text-muted); font-size: .8rem; }

/* Пилюли статусов */
.h-pill { --tone: var(--accent); display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 10px; border-radius: 999px; color: color-mix(in srgb, var(--tone) 78%, var(--text)); background: color-mix(in srgb, var(--tone) 16%, transparent); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.h-pill svg { width: 14px; height: 14px; }
.tone-accent { --tone: var(--accent); } .tone-warn { --tone: var(--h-warn); } .tone-ok { --tone: var(--h-ok); } .tone-danger { --tone: var(--danger); } .tone-violet { --tone: var(--h-violet); } .tone-info { --tone: var(--h-info); } .tone-muted { --tone: var(--text-muted); }
.h-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); background: color-mix(in srgb, var(--surface-strong) 70%, transparent); font-size: .76rem; font-weight: 650; white-space: nowrap; }
.h-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Обложки */
.h-cover { position: relative; display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; width: 56px; aspect-ratio: 3 / 4; border-radius: 12px; color: rgba(255, 255, 255, .9); background: linear-gradient(150deg, hsl(var(--h) 34% 52%), hsl(calc(var(--h) + 40) 30% 30%)); font-size: 1.4rem; font-weight: 800; }
.h-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-cover b { position: relative; z-index: 0; }
.h-cover img + b { display: none; }
.h-cover.is-sm { width: 40px; border-radius: 9px; font-size: 1rem; }
.h-cover.is-xs { width: 30px; border-radius: 7px; font-size: .8rem; }
.h-cover.is-lg { width: 132px; border-radius: 18px; font-size: 2.6rem; }
.h-cover.is-xl { width: 168px; border-radius: 22px; font-size: 3rem; box-shadow: var(--shadow-float); }

/* Аватары и ссылки на людей */
.h-av.is-xs { width: 24px; height: 24px; font-size: .7rem; }
.h-av.is-sm { width: 32px; height: 32px; }
.h-av.is-md { width: 44px; height: 44px; }
.h-av.is-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.h-user { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); font-weight: 650; text-decoration: none; }
.h-user > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.h-user:hover > span { text-decoration: underline; }
.h-user.is-empty { color: var(--text-muted); font-weight: 500; }
.h-stack { display: inline-flex; align-items: center; }
.h-stack > a { margin-left: -8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-strong); }
.h-stack > a:first-child { margin-left: 0; }
.h-online { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: .8rem; }
.h-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); opacity: .5; }
.h-online.is-on { color: var(--h-ok); }
.h-online.is-on::before { background: var(--h-ok); opacity: 1; }
.h-online.is-away::before { background: var(--h-warn); opacity: 1; }
.h-online.is-wait::before { background: var(--h-violet); opacity: 1; }

/* Полоски прогресса */
.h-bar { display: block; overflow: hidden; height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.h-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.h-tribar { display: flex; overflow: hidden; height: 9px; border-radius: 999px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 8%, transparent) 0 5px, color-mix(in srgb, var(--text) 16%, transparent) 5px 10px); }
.h-tribar .is-done { background: var(--accent); }
.h-tribar .is-avail { background: color-mix(in srgb, var(--accent) 35%, var(--surface-strong)); }
.h-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-muted); font-size: .78rem; }
.h-legend i { display: inline-block; width: 12px; height: 8px; margin-right: 5px; border-radius: 3px; vertical-align: middle; }
.h-legend .is-done { background: var(--accent); } .h-legend .is-avail { background: color-mix(in srgb, var(--accent) 35%, var(--surface-strong)); } .h-legend .is-lock { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 10%, transparent) 0 3px, color-mix(in srgb, var(--text) 22%, transparent) 3px 6px); }

/* Пусто, загрузка, ошибка */
.h-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 12px; color: var(--text-muted); text-align: center; }
.h-empty svg { width: 34px; height: 34px; opacity: .55; }
.h-empty p { margin: 0; max-width: 420px; }
.h-loading { display: flex; justify-content: center; gap: 8px; padding: 80px 0; }
.h-loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-strong); animation: h-blink 1s infinite ease-in-out; }
.h-loading span:nth-child(2) { animation-delay: .15s; } .h-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes h-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .h-loading span { animation: none; opacity: .7; } }
.h-error { display: flex; gap: 16px; align-items: flex-start; }
.h-error > svg { width: 32px; height: 32px; color: var(--danger); }
.h-error h2 { margin: 0 0 6px; }

/* Выпадающее меню «⋯» */
.h-menu { position: fixed; z-index: var(--layer-popover); min-width: 220px; max-width: 300px; padding: 6px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-strong); box-shadow: var(--shadow-card); }
.h-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; color: var(--text); background: none; font: inherit; font-size: .92rem; font-weight: 600; text-align: left; cursor: pointer; }
.h-menu button:hover, .h-menu button:focus-visible { background: var(--accent-weak); outline: none; }
.h-menu button svg { width: 17px; height: 17px; color: var(--text-muted); }
.h-menu button.is-danger { color: var(--danger); }
.h-menu button.is-danger svg { color: var(--danger); }

/* Окно */
.h-modal-wrap { position: fixed; inset: 0; z-index: var(--layer-modal); display: grid; place-items: center; padding: 16px; }
.h-modal-scrim { position: absolute; inset: 0; background: rgba(8, 14, 12, .45); backdrop-filter: blur(3px); }
.h-modal { position: relative; display: flex; flex-direction: column; width: min(520px, 100%); max-height: calc(100svh - 32px); border: 1px solid var(--border); border-radius: var(--radius-l); color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow-card); }
.h-modal.is-wide { width: min(820px, 100%); }
.h-modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 8px; }
.h-modal header h2 { margin: 0; font-size: 1.2rem; }
.h-modal-body { display: grid; gap: 14px; overflow-y: auto; padding: 10px 22px 18px; }
.h-modal footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--border); }
.h-modal footer .button { min-height: 42px; padding: 9px 18px; }
.h-modal-error { flex: 1 1 100%; color: var(--danger); font-size: .9rem; }
.h-modal-error:empty { display: none; }
.h-field { display: grid; gap: 6px; }
.h-field > span { color: var(--text-muted); font-size: .84rem; font-weight: 650; }
.h-field small { color: var(--text-muted); font-size: .78rem; }
.h-field :is(input, select, textarea), .h-input { width: 100%; min-height: 42px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); font: inherit; }
.h-field textarea { min-height: 92px; resize: vertical; }
.h-field :is(input, select, textarea):focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.h-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.h-check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.h-check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Уведомления */
.h-notif-panel { position: fixed; z-index: var(--layer-popover); width: min(380px, calc(100vw - 24px)); max-height: min(520px, calc(100svh - 90px)); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 20px; color: var(--text); background: var(--surface-strong); box-shadow: var(--shadow-card); }
.h-notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.h-notif-list { overflow-y: auto; padding: 6px; }
.h-notif-list .h-muted { margin: 12px; font-size: .9rem; }
.h-notif { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: .9rem; }
.h-notif small { color: var(--text-muted); font-size: .76rem; }
.h-notif:hover { background: var(--accent-weak); }
.h-notif.is-new { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.h-notif.is-new span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: middle; }

/* Строки списков (таблица-список) */
.h-list { display: grid; gap: 2px; }
.h-list-head { display: grid; align-items: center; gap: 12px; padding: 4px 14px 8px; color: var(--text-muted); font-size: .74rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.h-rowi { position: relative; display: grid; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-radius: 16px; color: var(--text); text-decoration: none; }
.h-rowi:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.h-rowi + .h-rowi::before { content: ""; position: absolute; top: -1px; left: 14px; right: 14px; border-top: 1px solid var(--border); }
.h-rowi:hover::before, .h-rowi:hover + .h-rowi::before { opacity: 0; }
.h-rowi .h-cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.h-rowi .h-name { display: grid; min-width: 0; }
.h-rowi .h-name b, .h-rowi .h-name a { overflow: hidden; color: var(--text); font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.h-rowi .h-name small { overflow: hidden; color: var(--text-muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.h-cell-num { color: var(--text-muted); font-size: .86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-stretch { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.h-rowi > *:not(.h-stretch) { position: relative; z-index: 1; }
.h-rowi .h-stretch-pass { pointer-events: none; }
.h-rowi .h-stretch-pass a, .h-rowi .h-stretch-pass button { pointer-events: auto; }
@media (max-width: 860px) { .h-list-head { display: none; } }

/* Сообщение для вкладки без данных у новичка / подсказки */
.h-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: .92rem; }
.h-note svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--accent); }
.h-note p { margin: 0; }

/* Страничка «скопировано» */
.h-copy { padding: 0; border: 0; color: inherit; background: none; font: inherit; text-align: left; cursor: copy; }
.h-copy:hover { text-decoration: underline dotted; }

/* Пагинация */
.h-pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.h-pager span { color: var(--text-muted); font-size: .9rem; }

/* ================= Проекты ================= */
.hp-grid { display: grid; gap: var(--h-gap); }
.hp-grid.is-active { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.hp-grid.is-offers { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.hp-grid.is-archive { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.hp-card { display: flex; gap: 16px; padding: 16px; transition: transform .15s ease, box-shadow .15s ease; }
.hp-card:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .hp-card { transition: none; } .hp-card:hover { transform: none; } }
.hp-card > *:not(.h-stretch) { position: relative; z-index: 1; pointer-events: none; }
.hp-card :is(a, button) { pointer-events: auto; }
.hp-card .h-cover.is-lg { width: 112px; }
.hp-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.hp-top { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.hp-dots { margin-left: auto; width: 30px; height: 30px; }
.hp-logo { max-width: 90px; max-height: 34px; margin-left: auto; object-fit: contain; }
.hp-logo + .hp-dots { margin-left: 0; }
.hp-card h3 { margin: 4px 0 0; overflow: hidden; font-size: 1.08rem; line-height: 1.2; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hp-orig { margin: 0; overflow: hidden; color: var(--text-muted); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.hp-meta { margin: 2px 0 0; color: var(--text-muted); font-size: .82rem; }
.hp-prog { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; margin-top: auto; padding-top: 10px; font-size: .8rem; }
.hp-prog > span { color: var(--text-muted); }
.hp-prog > b { font-variant-numeric: tabular-nums; }
.hp-prog > .h-bar { grid-column: 1 / -1; }
.hp-prog.is-big { margin: 0 0 16px; padding: 0; font-size: .92rem; }
.hp-prog.is-big b { font-size: 1.3rem; }
.hp-prog.is-big .h-bar { height: 10px; }
.hp-card.is-offer { flex-direction: column; gap: 10px; }
.hp-card.is-offer .hp-thumb { position: relative; }
.hp-card.is-offer .h-cover.is-lg { width: 100%; border-radius: 16px; }
.hp-stars { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px; padding: 18px 6px 8px; border-radius: 0 0 16px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); opacity: 0; transition: opacity .15s; }
.hp-card.is-offer:hover .hp-stars, .hp-card.is-offer:focus-within .hp-stars { opacity: 1; }
@media (hover: none) { .hp-stars { opacity: 1; } }
.hp-stars button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; color: rgba(255, 255, 255, .85); background: none; cursor: pointer; }
.hp-stars button svg { width: 20px; height: 20px; }
.hp-stars button.is-mine svg, .hp-stars:has(button:hover) button:has(~ button:hover) svg, .hp-stars button:hover svg { fill: #ffd36b; color: #ffd36b; }
.hp-avg { display: flex; align-items: center; gap: 4px; margin: 0; font-size: .84rem; font-weight: 700; }
.hp-avg svg { width: 15px; height: 15px; fill: var(--h-warn); color: var(--h-warn); }
.hp-avg span { color: var(--text-muted); font-weight: 500; }
.hp-card.is-archive .h-cover.is-lg { width: 84px; }
.h-link-plain { color: inherit; text-decoration: none; }
.h-link-plain:hover { text-decoration: underline; }
.h-list-tile { padding: 10px 8px; }
.h-chev { display: grid; place-items: center; color: var(--text-muted); }
.h-chev svg { width: 18px; height: 18px; }
@media (max-width: 860px) {
  .h-rowi { grid-template-columns: minmax(0, 1fr) auto auto !important; }
  .h-rowi > :not(.h-stretch):not(.h-cell-main):not(.h-pill):not(button):not(.h-chev) { display: none; }
}

/* Редактор проекта */
.hp-fieldset { display: grid; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 16px; }
.hp-fieldset legend { padding: 0 6px; color: var(--text-muted); font-size: .84rem; font-weight: 700; }
.hp-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.hp-deps { display: grid; gap: 6px; margin: 10px 0; }
.hp-dep { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .88rem; }
.hp-dep b { min-width: 80px; }
.h-check.is-mini { gap: 5px; font-size: .84rem; font-weight: 500; }
.h-check.is-mini input { width: 15px; height: 15px; }
.hp-res { display: grid; gap: 8px; }
.hp-res-row { display: grid; grid-template-columns: 170px 1fr 2fr auto; gap: 8px; }
.hp-res-row :is(input, select) { min-height: 38px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); font: inherit; font-size: .9rem; }
@media (max-width: 640px) { .hp-res-row { grid-template-columns: 1fr 1fr auto; } .hp-res-row select { grid-column: 1 / -1; } }
.hp-logo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hp-logo-pick img { max-width: 160px; max-height: 60px; object-fit: contain; }
.hp-logo-pick label { cursor: pointer; }
.h-link-btn.is-danger { color: var(--danger); }

/* Страница проекта */
.hp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: var(--h-gap); margin-bottom: var(--h-gap); }
@media (max-width: 1000px) { .hp-hero { grid-template-columns: 1fr; } }
.hp-head { display: flex; gap: 22px; }
.hp-head-main { display: flex; flex: 1; flex-direction: column; gap: 10px; min-width: 0; }
.hp-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hp-title-line h1 { margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -.03em; line-height: 1.05; }
.hp-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin-top: 4px; }
.hp-f { display: grid; gap: 1px; min-width: 0; font-size: .9rem; }
.hp-f > span:first-child { color: var(--text-muted); font-size: .76rem; font-weight: 650; }
.hp-f b, .hp-f .h-copy { overflow: hidden; font-weight: 650; text-overflow: ellipsis; }
.hp-f.is-wide { grid-column: 1 / -1; }
.hp-alts { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.hp-alts i { color: var(--text-muted); font-style: normal; }
.hp-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.hp-head-actions .hp-edit { margin-left: auto; }
.hp-bot { width: 40px; height: 40px; border: 1px solid var(--border); }
.hp-bot.is-on { color: var(--button-text); border-color: var(--accent); background: var(--accent); }
@media (max-width: 640px) { .hp-head { flex-direction: column; } .hp-head .h-cover.is-xl { width: 120px; } }
.hp-stage-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.hp-stage-row { display: grid; grid-template-columns: 96px 46px 1fr auto; align-items: center; gap: 10px; font-size: .88rem; }
.hp-stage-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.hp-stage-name svg { width: 16px; height: 16px; color: var(--accent); }
.hp-overview { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
.hp-overview .hp-about, .hp-overview .hp-lore { grid-column: 1 / -1; }
@media (max-width: 1000px) { .hp-overview { grid-template-columns: 1fr; } }
.hp-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .hp-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .hp-roles { grid-template-columns: 1fr; } }
.hp-role { display: grid; align-content: start; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--surface-strong) 55%, transparent); }
.hp-role-head { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: .82rem; }
.hp-role-head svg { width: 16px; height: 16px; color: var(--accent); }
.hp-role.is-curator .hp-role-head svg { color: var(--h-warn); }
.hp-person { display: flex; align-items: center; gap: 6px; }
.hp-person-link { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.hp-person-link > span { display: grid; min-width: 0; }
.hp-person-link b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-person-link:hover b { text-decoration: underline; }
.hp-vacant { display: flex; align-items: center; gap: 6px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted); font-size: .86rem; font-weight: 650; text-decoration: none; }
.hp-vacant:hover { color: var(--accent); border-color: var(--accent); }
.hp-vacant svg { width: 16px; height: 16px; }
.hp-role-add { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; }
.hp-role-add svg { width: 15px; height: 15px; }
.hp-link-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.hp-link-cols h3 { margin: 0 0 8px; color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.hp-link { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 0; font-weight: 650; }
.hp-link .h-icon-btn { width: 28px; height: 28px; }
.hp-note { margin: 0; line-height: 1.55; }
.hp-lore details { padding: 8px 0; border-top: 1px solid var(--border); }
.hp-lore summary { cursor: pointer; font-weight: 700; }
.hp-lore dt { margin-top: 8px; font-weight: 700; }
.hp-lore dd { margin: 2px 0 0; color: var(--text-muted); }

/* Главы проекта */
.hp-chapters { padding: 8px; }
.hp-ch { border-radius: 16px; }
.hp-ch + .hp-ch { border-top: 1px solid var(--border); }
.hp-ch.has-mine .hp-ch-row { box-shadow: inset 3px 0 0 var(--accent); }
.hp-ch-row { display: grid; grid-template-columns: 36px 34px minmax(110px, 1fr) 120px minmax(150px, auto) 90px 36px; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px; border-radius: 14px; cursor: pointer; }
.hp-ch-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hp-ch-name { color: var(--text); font-weight: 750; text-decoration: none; }
.hp-ch-name:hover { text-decoration: underline; }
.hp-ch-name small { color: var(--text-muted); font-weight: 500; }
.hp-ch-mini { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.hp-ch-mini small { color: var(--text-muted); font-size: .76rem; }
.hp-ch-pub { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.hp-st-list { display: none; gap: 2px; margin: 0 6px 10px 50px; padding: 6px; border-radius: 14px; background: color-mix(in srgb, var(--surface-strong) 55%, transparent); }
.hp-ch.is-open .hp-st-list { display: grid; }
.hp-ch.is-open .hp-ch-row { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hp-st-row { display: grid; grid-template-columns: 36px 110px 112px minmax(120px, 1fr) 140px 90px 36px 36px; align-items: center; gap: 8px; min-height: 44px; padding: 2px 6px; border-radius: 10px; }
.hp-st-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.hp-st-row.is-mine { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.hp-st-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .9rem; }
.hp-st-name svg { width: 16px; height: 16px; color: var(--accent); }
.hp-st-who { min-width: 0; font-size: .9rem; }
.h-cell-num svg { width: 14px; height: 14px; vertical-align: -2px; }
.h-cell-num.is-late, .is-late { color: var(--danger); }
.h-icon-btn.is-off { opacity: .25; cursor: default; }
@media (max-width: 860px) {
  .hp-ch-row { grid-template-columns: 30px minmax(0, 1fr) auto 34px; }
  .hp-ch-row > :nth-child(2), .hp-ch-row > :nth-child(4), .hp-ch-row > :nth-child(6) { display: none; }
  .hp-st-list { margin-left: 6px; }
  .hp-st-row { grid-template-columns: 30px minmax(0, 1fr) auto 30px 30px; }
  .hp-st-row > :nth-child(4), .hp-st-row > :nth-child(5), .hp-st-row > :nth-child(6) { display: none; }
}

/* Страница главы */
.hc-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--h-gap); padding: 16px 20px; }
.hc-title { flex: 1; min-width: 0; }
.hc-title h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.03em; }
.hc-title h1 small { color: var(--text-muted); font-size: .6em; font-weight: 600; }
.hc-title p { margin: 2px 0 0; font-size: .9rem; }
.hc-pub { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-nav { display: flex; gap: 4px; }
@media (max-width: 640px) { .hc-head { flex-wrap: wrap; } .hc-pub { order: 3; width: 100%; } }
.hc-path { margin-bottom: var(--h-gap); }
.hc-path-hint { font-size: .82rem; }
@media (max-width: 640px) { .hc-path-hint { display: none; } }
.hc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hc-step { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px 10px; border: 1px solid transparent; border-radius: 18px; text-align: center; }
.hc-step:not(:last-child)::after { content: ""; position: absolute; top: 34px; right: -9px; width: 10px; border-top: 2px dashed var(--border); }
.hc-step.is-current { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hc-step-link { display: grid; justify-items: center; gap: 4px; color: var(--text); text-decoration: none; }
.hc-step-ic { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--border); border-radius: 50%; color: var(--text-muted); background: var(--surface-strong); }
.hc-step-ic svg { width: 20px; height: 20px; }
.hc-step-link b { font-size: .92rem; }
.hc-step-link small { color: var(--text-muted); font-size: .74rem; }
.hc-step.is-done .hc-step-ic { color: var(--button-text); border-color: var(--h-ok); background: var(--h-ok); }
.hc-step.is-in_progress .hc-step-ic { color: var(--accent); border-color: var(--accent); }
.hc-step.is-assigned .hc-step-ic, .hc-step.is-free .hc-step-ic { color: var(--h-warn); border-color: var(--h-warn); }
.hc-step.is-submitted .hc-step-ic { color: var(--h-violet); border-color: var(--h-violet); }
.hc-step.is-revision .hc-step-ic { color: var(--danger); border-color: var(--danger); }
.hc-step.is-lock { opacity: .62; }
.hc-step-who { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; min-height: 24px; font-size: .8rem; }
.hc-step-who a { display: inline-flex; align-items: center; gap: 5px; max-width: 120px; color: var(--text); font-weight: 650; text-decoration: none; }
.hc-step-who a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-step-who small { color: var(--h-violet); }
.hc-step-date { color: var(--text-muted); font-size: .74rem; min-height: 1em; }
.hc-stage { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
.hc-stage .hc-notes { grid-column: 1 / -1; }
@media (max-width: 900px) { .hc-stage { grid-template-columns: 1fr; } }
.hc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 14px 0; }
.hc-facts dt { color: var(--text-muted); font-size: .78rem; font-weight: 650; }
.hc-facts dd { margin: 3px 0 0; font-weight: 650; }
.hc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hc-file-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hc-file { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 14px; }
.hc-file-main { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
.hc-file-main > svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
.hc-file-main span { display: grid; min-width: 0; }
.hc-file-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc-file-main small { color: var(--text-muted); font-size: .76rem; }
.hc-file-main:hover b { text-decoration: underline; }
.hc-note { padding: 10px 0; border-top: 1px solid var(--border); }
.hc-note p { margin: 4px 0 0; }
.hc-publish { display: grid; gap: var(--h-gap); }
.hc-pub-rows { display: grid; gap: 10px; }
.hc-pub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; }
.hc-pub-row > svg { width: 20px; height: 20px; color: var(--accent); }
.hc-pub-row > b { min-width: 100px; }
.hc-pub-row .button { margin-left: auto; }
.hc-soon { display: grid; justify-items: start; gap: 6px; opacity: .85; }
.hc-soon > svg { width: 26px; height: 26px; color: var(--accent); }
.hc-soon p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.hc-soon-note { margin: 0; font-size: .84rem; }

/* История */
.h-feed { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.h-ev { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: .93rem; line-height: 1.4; }
.h-ev:last-child { border-bottom: 0; }
.h-ev-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--accent); background: var(--accent-weak); }
.h-ev-ic svg { width: 16px; height: 16px; }
.h-ev-text { padding-top: 5px; }
.h-ev-text a { color: var(--text); font-weight: 650; }
.h-ev-who { color: var(--text) !important; font-weight: 750 !important; text-decoration: none; }
.h-ev-who:hover { text-decoration: underline; }
.h-ev-time { padding-top: 6px; color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
@media (max-width: 560px) { .h-ev { grid-template-columns: 30px minmax(0, 1fr); } .h-ev-time { grid-column: 2; padding-top: 0; } }

/* Загрузка файла */
.h-drop { display: grid; justify-items: center; gap: 4px; padding: 22px; border: 2px dashed var(--border); border-radius: 16px; color: var(--text-muted); text-align: center; cursor: pointer; }
.h-drop:hover, .h-drop.is-over, .h-drop:focus-within { border-color: var(--accent); color: var(--text); }
.h-drop > svg { width: 30px; height: 30px; color: var(--accent); }
.h-drop b { color: var(--text); }
.h-drop small { font-size: .8rem; }
.h-drop-name { margin-top: 4px; color: var(--text); font-weight: 650; }
.h-drop-bar { display: block; width: 100%; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: var(--border); }
.h-drop-bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s; }
.h-or { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .82rem; }
.h-or::before, .h-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* Шапка: разделы идут сразу после названия команды, поиск — справа (чтобы четыре раздела не наезжали на поиск) */
@media (min-width: 761px) {
  .topbar nav { position: static; transform: none; margin: 0 auto 0 18px; }
  .topbar .nav-search { width: min(250px, 24%); margin: 0 10px 0 0; }
}
@media (min-width: 761px) and (max-width: 1180px) { .topbar nav .nav-item span { display: none; } .topbar .h-team-name { display: none; } }
.h-tag.h-copy { border: 1px solid var(--border); cursor: copy; }

/* ================= Главная ================= */
.hh-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "stats stats stats stats" "cur cur mem tg" "feed feed tasks deco"; gap: var(--h-gap); }
.hh-stats { grid-area: stats; } .hh-current { grid-area: cur; } .hh-members { grid-area: mem; } .hh-tg { grid-area: tg; } .hh-feed { grid-area: feed; } .hh-tasks { grid-area: tasks; } .hh-deco { grid-area: deco; }
@media (max-width: 1100px) { .hh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "stats stats" "cur cur" "mem tg" "feed feed" "tasks deco"; } }
@media (max-width: 640px) { .hh-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stats" "cur" "tasks" "mem" "tg" "feed" "deco"; } }
.hh-stats .h-stat b.is-late { color: var(--danger); }
.hh-stats .h-stat b { font-size: 1.45rem; }
.hh-arrows { display: flex; gap: 2px; }
.hh-track { position: relative; display: grid; }
.hh-slide { grid-area: 1 / 1; display: flex; gap: 20px; visibility: hidden; opacity: 0; transition: opacity .35s ease; }
.hh-slide.is-active { visibility: visible; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hh-slide { transition: none; } }
.hh-slide .h-cover.is-lg { width: 150px; }
.hh-slide-body { display: flex; flex: 1; flex-direction: column; gap: 8px; min-width: 0; }
.hh-slide h3 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.hh-slide .hp-prog { margin: auto 0 4px; }
.hh-slide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.hh-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: width .2s; }
.hh-dots button.is-active { width: 22px; background: var(--accent); }
@media (max-width: 520px) { .hh-slide { flex-direction: column; } .hh-slide .h-cover.is-lg { width: 110px; } }
.hh-people { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hh-people a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.hh-people a:hover { background: var(--accent-weak); }
.hh-p-name { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 0; }
.hh-p-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hh-p-name .badge-chip { transform: scale(.85); }
.hh-people .h-online::before { width: 9px; height: 9px; }
.hh-more { display: block; margin-top: 6px; padding: 6px 8px; color: var(--text-muted); font-size: .88rem; font-weight: 650; text-decoration: none; }
.hh-more:hover { color: var(--accent); }
.hh-tg { display: grid; gap: 8px; }
.hh-tg-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); font-weight: 650; text-decoration: none; }
.hh-tg-link > svg:first-child { width: 20px; height: 20px; color: var(--accent); }
.hh-tg-link > span { flex: 1; }
.hh-tg-link > svg:last-child { width: 16px; height: 16px; color: var(--text-muted); }
.hh-tg-link:hover { border-color: var(--accent); }
.hh-tg-link.is-empty { opacity: .6; }
.hh-tg-link small { color: var(--text-muted); font-size: .76rem; font-weight: 500; }
.hh-feed .h-chips { margin-bottom: 8px; }
.hh-feed .h-chip { min-height: 30px; padding: 4px 12px; font-size: .82rem; }
.hh-tasks-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.hh-tasks-list a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--text); text-decoration: none; }
.hh-tasks-list a:hover { background: var(--accent-weak); }
.hh-tasks-list a > svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent); }
.hh-tasks-list span { display: grid; flex: 1; min-width: 0; }
.hh-tasks-list b { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.hh-tasks-list small { color: var(--text-muted); font-size: .78rem; }
.hh-cat { display: grid; justify-items: center; gap: 6px; padding: 10px 0; color: var(--text-muted); text-align: center; }
.hh-cat svg { color: var(--accent); }
.hh-cat p { margin: 0; }
.hh-deco { display: grid; place-items: center; overflow: hidden; background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--surface-strong)), color-mix(in srgb, var(--cover-rain) 30%, var(--surface-strong))); }
.hh-deco-in { display: grid; justify-items: center; gap: 4px; color: var(--accent); text-align: center; }
.hh-deco-bow svg { width: 64px; height: 44px; }
.hh-deco-in b { color: var(--text); font-size: 1.05rem; }
.hh-deco-cat svg { width: 110px; height: 80px; }
.hh-deco-text { margin: 0; font-family: var(--h-quote-font); font-size: 1.7rem; transform: rotate(-4deg); }
.ht-prog { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; }
.ht-prog small { color: var(--text-muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
.ht-hint { display: flex; align-items: center; gap: 6px; margin: 12px 4px 0; font-size: .82rem; }
.ht-hint svg { width: 15px; height: 15px; }

/* ================= Команда ================= */
.ht-stats { margin-bottom: var(--h-gap); }
.ht-stat { border: 1px solid var(--border); font: inherit; text-align: left; cursor: pointer; }
.ht-stat.is-active { outline: 2px solid var(--accent); outline-offset: -2px; }
.ht-dir svg { width: 18px; height: 18px; }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--h-gap); }
.ht-card { display: flex; align-items: center; gap: 14px; padding: 12px; }
.ht-card > *:not(.h-stretch) { position: relative; z-index: 1; pointer-events: none; }
.ht-card :is(a, button) { pointer-events: auto; }
.ht-card:hover { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
.ht-av-in { position: relative; display: grid; flex: 0 0 auto; place-items: center; width: 76px; height: 76px; overflow: visible; border-radius: 18px; color: rgba(255, 255, 255, .92); background: linear-gradient(150deg, hsl(var(--h) 40% 58%), hsl(calc(var(--h) + 40) 34% 36%)); font-size: 1.7rem; font-weight: 800; }
.ht-av-in img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.ht-on { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border: 3px solid var(--surface-strong); border-radius: 50%; background: var(--h-ok); }
.ht-card-body { display: grid; flex: 1; gap: 6px; min-width: 0; }
.ht-card-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.ht-nick { overflow: hidden; font-size: 1.02rem; text-overflow: ellipsis; white-space: nowrap; }
.ht-dots { margin-left: auto; width: 30px; height: 30px; }
.ht-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 28px; }
.ht-role-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--accent); background: var(--accent-weak); }
.ht-role-ic svg { width: 16px; height: 16px; }
.ht-role-more { color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.ht-role-words { font-size: .9rem; }
.ht-role-checks { display: grid; gap: 10px; }
.ht-role-checks svg { width: 17px; height: 17px; color: var(--accent); }
/* Роли: 4 сверху, остальные по центру снизу */
.ht-roles-top, .ht-roles-rest { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--h-gap); }
.ht-roles-rest { display: flex; flex-wrap: wrap; justify-content: center; margin-top: var(--h-gap); }
.ht-roles-rest > * { flex: 0 1 calc((100% - 3 * var(--h-gap)) / 4); }
@media (max-width: 1000px) { .ht-roles-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ht-roles-rest > * { flex-basis: calc((100% - var(--h-gap)) / 2); } }
@media (max-width: 560px) { .ht-roles-top { grid-template-columns: 1fr; } .ht-roles-rest > * { flex-basis: 100%; } }
.ht-rolecard { display: flex; flex-direction: column; gap: 12px; }
.ht-rolecard > *:not(.h-stretch) { position: relative; z-index: 1; pointer-events: none; }
.ht-rolecard :is(a, button) { pointer-events: auto; }
.ht-rolecard:hover { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -2px; }
.ht-rc-head { display: flex; align-items: center; gap: 12px; }
.ht-rc-head > span:last-child { display: grid; }
.ht-rc-head b { font-size: 1.08rem; }
.ht-rc-head small { color: var(--text-muted); font-size: .82rem; }
.ht-rc-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: var(--accent); background: var(--accent-weak); vertical-align: middle; }
.ht-rc-ic svg { width: 24px; height: 24px; }
.h-tile-head h2 .ht-rc-ic { width: 34px; height: 34px; border-radius: 11px; }
.h-tile-head h2 .ht-rc-ic svg { width: 19px; height: 19px; }
.ht-rolecard.is-curator .ht-rc-ic { color: var(--h-warn); background: color-mix(in srgb, var(--h-warn) 16%, transparent); }
.ht-rolecard ul { display: grid; gap: 4px; margin: 0; padding-left: 18px; color: var(--text-muted); font-size: .9rem; }
.ht-rc-people { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 34px; margin-top: auto; }
.ht-rc-btn { align-self: stretch; }
.ht-role-page { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: var(--h-gap); align-items: start; }
.ht-role-page .ht-role-mats { grid-column: 1; }
.ht-role-people { grid-row: span 2; }
@media (max-width: 900px) { .ht-role-page { grid-template-columns: 1fr; } .ht-role-people { grid-row: auto; } }
.ht-text { line-height: 1.6; }
.ht-bul { display: grid; gap: 6px; margin: 0; padding-left: 20px; line-height: 1.5; }
.ht-bul.is-num { padding-left: 22px; }
.ht-role-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ht-details { margin-top: 12px; }
.ht-details summary { cursor: pointer; font-weight: 700; }
.ht-join { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
.ht-join-form { grid-column: 1 / -1; display: grid; gap: 14px; }
.ht-join-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
@media (max-width: 800px) { .ht-join { grid-template-columns: 1fr; } }
.ht-join-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--h-gap); }
.ht-join-role { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.ht-join-role svg { width: 28px; height: 28px; color: var(--accent); }
.ht-join-role small { color: var(--text-muted); }
.ht-join-role:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.ht-apps { display: grid; gap: var(--h-gap); }
.ht-app { display: grid; gap: 8px; }
.ht-app-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ht-app-head b { font-size: 1.05rem; }
.ht-app-contact, .ht-app-note { margin: 0; }
.ht-app-contact { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.ht-app-contact svg { width: 16px; height: 16px; }
.ht-app-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ht-app-links svg { width: 15px; height: 15px; vertical-align: -2px; }
.ht-app-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ht-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--h-gap); align-items: start; }
.ht-links { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ht-links a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-weight: 650; text-decoration: none; }
.ht-links a:hover { background: var(--accent-weak); }
.ht-links svg { width: 16px; height: 16px; color: var(--text-muted); }
.ht-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--h-gap); align-items: start; }
.ht-mat.is-test { border-style: dashed; }
.ht-mat-hint { margin: -6px 0 10px; font-size: .86rem; }

/* Расписание */
.hs-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
.hs-wrap.is-month { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .hs-wrap { grid-template-columns: 1fr; } .hs-mini { order: 2; } }
.hs-mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.hs-mini-head span { display: flex; }
.hs-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.hs-mini-dow { color: var(--text-muted); font-size: .72rem; font-weight: 700; padding: 4px 0; }
.hs-mini-d { position: relative; height: 32px; padding: 0; border: 0; border-radius: 10px; color: var(--text); background: none; font: inherit; font-size: .86rem; cursor: pointer; }
.hs-mini-d:hover { background: var(--accent-weak); }
.hs-mini-d.is-out { color: var(--text-muted); opacity: .5; }
.hs-mini-d.is-week { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hs-mini-d.is-today { color: var(--button-text); background: var(--dark); font-weight: 800; }
.hs-mini-d.has-rel::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.hs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.hs-bar h2 { margin: 0; font-size: 1.2rem; }
.hs-bar .h-select { min-height: 34px; }
.hs-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .hs-week { grid-template-columns: 1fr; } }
.hs-day { display: flex; flex-direction: column; gap: 6px; min-height: 260px; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-strong) 45%, transparent); }
@media (max-width: 900px) { .hs-day { min-height: 0; } }
.hs-day.is-today { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.hs-day.is-out { opacity: .5; }
.hs-day-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: .8rem; font-weight: 700; }
.hs-day.is-today .hs-day-head { color: var(--accent); }
.hs-add { width: 24px; height: 24px; opacity: 0; }
.hs-add svg { width: 15px; height: 15px; }
.hs-day:hover .hs-add, .hs-add:focus-visible { opacity: 1; }
@media (hover: none) { .hs-add { opacity: .7; } }
.hs-cards { display: grid; gap: 6px; }
.hs-card { display: grid; gap: 1px; padding: 7px 9px; border: 0; border-left: 4px solid var(--k); border-radius: 10px; color: var(--text); background: color-mix(in srgb, var(--k) 18%, var(--surface-strong)); font: inherit; text-align: left; cursor: pointer; }
.hs-card:hover { background: color-mix(in srgb, var(--k) 28%, var(--surface-strong)); }
.hs-card b { overflow: hidden; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.hs-card small, .hs-time { color: var(--text-muted); font-size: .72rem; }
.hs-time:empty { display: none; }
.hs-month-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; color: var(--text-muted); font-size: .76rem; font-weight: 700; text-align: center; }
.hs-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.hs-month .hs-day { min-height: 110px; }
@media (max-width: 700px) { .hs-month .hs-day { min-height: 70px; padding: 4px; } .hs-month .hs-card small { display: none; } }
.hs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; color: var(--text-muted); font-size: .82rem; }
.hs-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: middle; }
.hs-kinds { display: grid; gap: 8px; }
.hs-kind-row { grid-template-columns: 1fr 60px auto; }
.hs-kind-row input[type="color"] { padding: 2px; }

/* Публичная страница (тестовое без входа) */
html.is-public-page #login-screen, html.is-public-page #profile-screen { display: none !important; }
.h-public { min-height: 100svh; padding: 16px; background: linear-gradient(125deg, var(--login-shadow) 0%, var(--login-mid) 42%, var(--login-light) 100%) fixed; }
.h-public-top { display: flex; align-items: center; gap: 10px; width: min(1240px, 100%); margin: 0 auto; padding: 10px 18px; border-radius: 999px; color: var(--text); background: var(--surface); backdrop-filter: blur(16px); }
.h-public-top .h-bow { color: var(--accent); }
.h-public .hub-page.is-public { display: block; margin-top: 48px; }

/* ================= Профиль ================= */
.h-grow { flex: 1 1 auto; }
.profile-screen[data-view="profile"] :is(.works-section, #member-titles-section, .profile-card .metrics, #go-titles) { display: none !important; }
.profile-screen:not([data-view="profile"]) #hub-profile { display: none !important; }
.hpf { position: relative; z-index: calc(var(--layer-content) + 1); width: min(1120px, calc(100% - 32px)); margin: var(--h-gap) auto 64px; }
.hpf-about { margin: 6px 0 0; color: var(--text-muted); font-style: italic; line-height: 1.4; }
.hpf-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hpf-card-actions:empty { display: none; }
.hpf-dots { border: 1px solid var(--border); }
.hpf-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: var(--h-gap); align-items: start; margin-bottom: var(--h-gap); }
.hpf-top.is-other { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 800px) { .hpf-top { grid-template-columns: 1fr; } }
.hpf-info dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.hpf-top.is-other .hpf-info dl { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (max-width: 520px) { .hpf-info dl { grid-template-columns: 1fr; } }
.hpf-info-row { display: grid; grid-template-columns: 40px 1fr; align-items: center; column-gap: 12px; }
.hpf-info-ic { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--accent); background: var(--accent-weak); }
.hpf-info-ic svg { width: 19px; height: 19px; }
.hpf-info dt { color: var(--text-muted); font-size: .76rem; font-weight: 650; }
.hpf-info dd { margin: 0; font-weight: 650; }
.hpf-quick { display: grid; gap: 8px; align-content: start; }
.hpf-quick .h-tile-head { margin-bottom: 4px; }
.hpf-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); background: color-mix(in srgb, var(--surface-strong) 50%, transparent); font: inherit; font-weight: 650; text-align: left; text-decoration: none; cursor: pointer; }
.hpf-q:hover { border-color: var(--accent); }
.hpf-q > svg:first-child { width: 19px; height: 19px; color: var(--accent); }
.hpf-q > span:not(.h-count) { flex: 1; }
.hpf-q > svg:last-child { width: 16px; height: 16px; color: var(--text-muted); }
.hpf-ov { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--h-gap); align-items: start; }
.hpf-ov .hpf-ach-mini { grid-column: 1 / -1; }
@media (max-width: 800px) { .hpf-ov { grid-template-columns: 1fr; } }
.hpf-stats { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--h-gap); align-items: stretch; }
@media (max-width: 1000px) { .hpf-stats { grid-template-columns: 1fr; } }
.hpf-st { padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface-strong) 50%, transparent); font: inherit; text-align: left; }
button.hpf-st { cursor: pointer; }
.hpf-st b { font-size: 1.4rem; }
.hpf-donut-in { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hpf-donut-in ul { display: grid; flex: 1; gap: 8px; min-width: 140px; margin: 0; padding: 0; list-style: none; font-size: .9rem; }
.hpf-donut-in li { display: flex; align-items: center; gap: 8px; }
.hpf-donut-in li i { width: 10px; height: 10px; border-radius: 50%; }
.hpf-donut-in li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.hpf-donut-n { fill: var(--text); font-size: 22px; font-weight: 800; }
.hpf-donut-l { fill: var(--text-muted); font-size: 10px; }
.hpf-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.hpf-badge { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin: auto; }
.hpf-badge > svg:first-child { position: absolute; inset: 0; width: 100%; height: 100%; fill: color-mix(in srgb, var(--text) 10%, transparent); stroke: color-mix(in srgb, var(--text) 18%, transparent); stroke-width: 1.5; }
.hpf-badge > svg:last-child { position: relative; width: 24px; height: 24px; color: var(--text-muted); }
.hpf-badge.is-got > svg:first-child { fill: color-mix(in srgb, var(--accent) 30%, var(--surface-strong)); stroke: var(--accent); }
.hpf-badge.is-got > svg:last-child { color: var(--accent); }
.hpf-ach-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hpf-ach-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 16px; }
.hpf-ach-row .hpf-badge { width: 52px; height: 52px; margin: 0; flex: 0 0 auto; }
.hpf-ach-row > span:nth-child(2) { display: grid; flex: 1; }
.hpf-ach-row small { color: var(--text-muted); }
.hpf-ach-row:not(.is-got) { opacity: .7; }
.hpf-role { overflow: hidden; color: var(--text-muted); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.hpf-set { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
@media (max-width: 800px) { .hpf-set { grid-template-columns: 1fr; } }
.hpf-set-nav { display: grid; gap: 4px; padding: 10px; }
.hpf-set-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 12px; color: var(--text); background: none; font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.hpf-set-nav button svg { width: 18px; height: 18px; color: var(--text-muted); }
.hpf-set-nav button:hover { background: var(--accent-weak); }
.hpf-set-nav button.is-active { color: var(--button-text); background: var(--dark); }
.hpf-set-nav button.is-active svg { color: inherit; }
@media (max-width: 800px) { .hpf-set-nav { display: flex; overflow-x: auto; } .hpf-set-nav button { white-space: nowrap; } }
.hpf-set-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--h-gap); align-items: start; }
.hpf-set-grid > section:last-child { grid-column: 1 / -1; }
.hpf-set-grid section.tile { display: grid; gap: 14px; }
@media (max-width: 900px) { .hpf-set-grid { grid-template-columns: 1fr; } }
.hpf-set-av { justify-items: center; text-align: center; }
.hpf-av-prev .h-av.is-lg { width: 120px; height: 120px; font-size: 2.6rem; }
.hpf-save { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.hpf-sub { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.hpf-sub span { flex: 1; font-weight: 650; }
.hpf-more-subs { margin-top: 12px; }
.hpf-more-subs summary { cursor: pointer; color: var(--text-muted); font-weight: 650; }
.hpf-look { display: grid; gap: 4px; }
.hpf-look-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.hpf-look-row span { display: grid; flex: 1; }
.hpf-look-row small { color: var(--text-muted); font-size: .82rem; }
.hpf-look-actions { margin: 14px 0 8px; }
/* Переключатель */
.h-switch { appearance: none; position: relative; flex: 0 0 auto; width: 44px; height: 26px; margin: 0; border-radius: 999px; background: color-mix(in srgb, var(--text) 18%, transparent); cursor: pointer; transition: background .15s; }
.h-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.h-switch:checked { background: var(--accent); }
.h-switch:checked::after { transform: translateX(18px); }
.h-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Форма аватара «рассеивание вправо»: картинка занимает левую часть карточки и растворяется вправо */
.profile-card:has(.avatar-wrap[data-shape="fade"]) { min-height: 250px; overflow: hidden; }
.profile-card:has(.avatar-wrap[data-shape="fade"]) .identity-row { position: static; }
.avatar-wrap[data-shape="fade"] { position: absolute !important; top: 0; bottom: 0; left: 0; z-index: 0; width: min(46%, 440px); }
.avatar-wrap[data-shape="fade"] .avatar { width: 100%; height: 100%; border: 0; border-radius: var(--card-radius, var(--radius-l)) 0 0 var(--card-radius, var(--radius-l)); box-shadow: none !important; background-size: cover !important; background-position: var(--avatar-x, 50%) var(--avatar-y, 50%) !important; -webkit-mask: linear-gradient(90deg, #000 40%, transparent 100%); mask: linear-gradient(90deg, #000 40%, transparent 100%); }
.avatar-wrap[data-shape="fade"] .avatar-edit { left: auto; right: 22%; bottom: 14px; }
.profile-card:has(.avatar-wrap[data-shape="fade"]) .identity-copy { position: relative; z-index: 1; margin-left: max(0px, calc(min(46%, 440px) - 80px)); }
.profile-card:has(.avatar-wrap[data-shape="fade"]) :is(.profile-actions, .tag-manager, .metrics) { position: relative; z-index: 1; }
@media (max-width: 640px) {
  .avatar-wrap[data-shape="fade"] { width: 100%; bottom: auto; height: 200px; }
  .avatar-wrap[data-shape="fade"] .avatar { border-radius: var(--card-radius, var(--radius-l)) var(--card-radius, var(--radius-l)) 0 0; -webkit-mask: linear-gradient(180deg, #000 40%, transparent 100%); mask: linear-gradient(180deg, #000 40%, transparent 100%); }
  .profile-card:has(.avatar-wrap[data-shape="fade"]) .identity-copy { margin: 150px 0 0; }
}
a.button { text-decoration: none; }
@media (min-width: 761px) { .topbar nav { position: relative; left: auto; top: auto; } }
.hh-tg-link { min-width: 0; }
.hh-tg-name { display: grid; flex: 1; min-width: 0; }
.hh-tg-name small { color: var(--text-muted); font-size: .74rem; font-weight: 500; }
.h-link-btn { display: inline-flex; align-items: center; gap: 5px; }
.h-link-btn svg, .h-link svg { width: 16px; height: 16px; }
.ht-tests { margin-top: var(--h-gap); }
.ht-tests > summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; font-weight: 750; cursor: pointer; list-style: none; }
.ht-tests > summary::-webkit-details-marker { display: none; }
.ht-tests > summary svg { width: 20px; height: 20px; color: var(--accent); }
.ht-tests > summary .h-muted { font-weight: 500; font-size: .88rem; }
.ht-tests[open] > summary { margin-bottom: var(--h-gap); }

/* Телефон: шапка в две строки (значки разделов + поиск), заголовок страницы остаётся на картинке-фоне */
@media (max-width: 760px) {
  .topbar { border-radius: 26px; padding: 8px 10px; }
  .topbar .h-team-name { display: none; }
  .topbar nav { margin: 0 auto 0 2px; gap: 0; }
  .topbar .nav-item { padding: 8px 9px; }
  .topbar > .icon-button { padding: 8px; }
  .hub-page { margin-top: 34px; }
  .hpf { width: calc(100% - 24px); }
  .hub-page .button-dark { width: auto; }
}
@media (max-width: 380px) { .topbar .nav-item { padding: 7px 6px; } }
@media (max-width: 760px) {
  .topbar nav { position: relative; left: auto; top: auto; }
  .topbar { column-gap: 0; }
  .topbar .brand { padding: 6px 4px; }
  .topbar > .icon-button, .topbar #topbar-avatar { margin: 0; padding: 7px 6px; }
  .topbar .nav-item { padding: 8px 7px; }
}
@media (max-width: 640px) {
  .ht-stats.h-cols-4, .hh-stats.h-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ht-stats .h-stat, .hh-stats .h-stat { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 0; padding: 14px; }
  .ht-stats .h-stat-ic, .hh-stats .h-stat-ic { width: 36px; height: 36px; border-radius: 12px; }
  .hh-stats .h-stat small { display: none; }
}
.topbar nav > .glide { display: block !important; }
