/*
 * Дизайн-система VOE.
 *
 * Один файл без сборки — проект поднимается artisan serve, без npm.
 * Устроен слоями: токены → база → раскладка → компоненты → экраны → адаптив.
 * Тема следует настройке системы и переключателю в шапке (data-theme).
 *
 * Цвета графиков — отдельные токены (--viz-*): порядковая рампа одного тона,
 * проверенная на монотонность светлоты и контраст с поверхностью.
 */

/* ============================================================ ТОКЕНЫ */

:root {
  color-scheme: light;

  /* Поверхности: тёплая бумага под контентом, белые карточки поверх. */
  --bg:          #F6F5F1;
  --bg-tint:     #EFEEE8;
  --surface:     #FFFFFF;
  --surface-2:   #F4F3EE;
  --surface-3:   #EAE9E2;
  --overlay:     rgba(19, 21, 17, .38);

  /* Текст */
  --ink:         #131511;
  --ink-2:       #4B4F46;
  --ink-3:       #7C8177;
  --ink-4:       #A9AEA3;

  /* Линии */
  --line:        rgba(19, 21, 17, .10);
  --line-2:      rgba(19, 21, 17, .18);

  /* Бренд */
  --accent:      #14664A;
  --accent-hi:   #0F5238;
  --on-accent:   #FFFFFF;
  --accent-lo:   #E7F1EC;
  --accent-ink:  #0C4531;

  /* Второй акцент — статусы «в работе», отметки редакции */
  --gold:        #A97C2F;
  --gold-lo:     #F7EFE0;

  --danger:      #A93226;
  --danger-lo:   #FAEBE8;
  --info:        #2A5F9E;
  --info-lo:     #E9F0F9;

  /* Данные: порядковая рампа одного тона + цвет затухания */
  --viz-1:       #6FBF9F;
  --viz-2:       #3FA37D;
  --viz-3:       #22815C;
  --viz-4:       #0F5238;
  --viz-mute:    #A9ADA4;
  --viz-track:   #EAE9E2;

  /* Тени: мягкие, тёплые, почти незаметные */
  --shadow-1:  0 1px 2px rgba(19, 21, 17, .05), 0 1px 3px rgba(19, 21, 17, .04);
  --shadow-2:  0 4px 12px rgba(19, 21, 17, .07), 0 2px 4px rgba(19, 21, 17, .04);
  --shadow-3:  0 18px 40px rgba(19, 21, 17, .13), 0 4px 12px rgba(19, 21, 17, .07);

  /* Скругления */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;

  /* Шаг сетки */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 22px; --s-6: 30px; --s-7: 42px; --s-8: 60px; --s-9: 84px;

  /* Типографика */
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;

  --t-xs:   12px;
  --t-sm:   13px;
  --t-base: 14.5px;
  --t-md:   16px;
  --t-lg:   18px;
  --t-xl:   clamp(21px, 1.4vw + 16px, 25px);
  --t-2xl:  clamp(26px, 2vw + 18px, 34px);
  --t-3xl:  clamp(32px, 3.4vw + 20px, 52px);

  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Тёмная тема: та же система, свои поверхности и свои шаги рампы. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg:        #0F110F;
    --bg-tint:   #151815;
    --surface:   #171A17;
    --surface-2: #1E221E;
    --surface-3: #262B26;
    --overlay:   rgba(0, 0, 0, .55);

    --ink:       #F1F2EC;
    --ink-2:     #BEC3B9;
    --ink-3:     #8D948A;
    --ink-4:     #666C64;

    --line:      rgba(255, 255, 255, .10);
    --line-2:    rgba(255, 255, 255, .18);

    --accent:    #4FB68C;
    --accent-hi: #6ECBA3;
    --on-accent: #0F110F;
    --accent-lo: rgba(79, 182, 140, .13);
    --accent-ink:#8FDCBA;

    --gold:      #D6A961;
    --gold-lo:   rgba(214, 169, 97, .14);
    --danger:    #E0776A;
    --danger-lo: rgba(224, 119, 106, .14);
    --info:      #7FA9DE;
    --info-lo:   rgba(127, 169, 222, .14);

    --viz-1:     #7FC7AC;
    --viz-2:     #57B392;
    --viz-3:     #2F9670;
    --viz-4:     #1F8259;
    --viz-mute:  #5B615C;
    --viz-track: #262B26;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 6px 16px rgba(0, 0, 0, .45);
    --shadow-3: 0 20px 44px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0F110F;
  --bg-tint:   #151815;
  --surface:   #171A17;
  --surface-2: #1E221E;
  --surface-3: #262B26;
  --overlay:   rgba(0, 0, 0, .55);

  --ink:       #F1F2EC;
  --ink-2:     #BEC3B9;
  --ink-3:     #8D948A;
  --ink-4:     #666C64;

  --line:      rgba(255, 255, 255, .10);
  --line-2:    rgba(255, 255, 255, .18);

  --accent:    #4FB68C;
  --accent-hi: #6ECBA3;
  --on-accent: #0F110F;
  --accent-lo: rgba(79, 182, 140, .13);
  --accent-ink:#8FDCBA;

  --gold:      #D6A961;
  --gold-lo:   rgba(214, 169, 97, .14);
  --danger:    #E0776A;
  --danger-lo: rgba(224, 119, 106, .14);
  --info:      #7FA9DE;
  --info-lo:   rgba(127, 169, 222, .14);

  --viz-1:     #7FC7AC;
  --viz-2:     #57B392;
  --viz-3:     #2F9670;
  --viz-4:     #1F8259;
  --viz-mute:  #5B615C;
  --viz-track: #262B26;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 6px 16px rgba(0, 0, 0, .45);
  --shadow-3: 0 20px 44px rgba(0, 0, 0, .55);
}

/* ============================================================ БАЗА */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }
b, strong { font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em;
       background: var(--surface-2); padding: 1px 5px; border-radius: var(--r-xs); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--accent-lo); color: var(--accent-ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--r-full);
                            border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }

/* ============================================================ ТИПОГРАФИКА */

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; letter-spacing: -.011em; }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); }
h4 { font-size: var(--t-base); }

.display {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.display-xl { font-size: var(--t-3xl); }

.lead      { font-size: var(--t-md); color: var(--ink-2); line-height: 1.6; }
.muted     { color: var(--ink-3); }
.small     { font-size: var(--t-sm); }
.xs        { font-size: var(--t-xs); }
.num       { font-variant-numeric: tabular-nums; }
.upper     { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 600; }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Длинный текст кейса читается серифом и узкой колонкой. */
.prose { font-family: var(--font-display); font-size: 17px; line-height: 1.65; color: var(--ink-2); max-width: 68ch; }
.prose p + p { margin-top: .85em; }
.prose strong { color: var(--ink); }

/* ============================================================ РАСКЛАДКА */

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--s-5); }
.wrap-narrow { max-width: 780px; }
.wrap-mid    { max-width: 960px; }

.site-main { flex: 1 0 auto; padding: var(--s-6) 0 var(--s-9); }

.stack > * + *      { margin-top: var(--s-3); }
.stack-lg > * + *   { margin-top: var(--s-5); }
.row   { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.row-tight { gap: var(--s-2); }
.spread{ display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow  { flex: 1 1 320px; min-width: 0; }
.mt    { margin-top: var(--s-5); }
.mb    { margin-bottom: var(--s-5); }
.mt-sm { margin-top: var(--s-3); }
.mb-sm { margin-bottom: var(--s-3); }

.grid   { display: grid; gap: var(--s-4); }
.support-split { display: flex; align-items: stretch; }
.support-split > .card {
  flex: 1 1 0;
  margin: 0;
  height: auto;
  display: flex;
  flex-direction: column;
}
.support-split .support-reply { margin-top: auto; }

.support-chat { display: flex; flex-direction: column; min-height: calc(100vh - 140px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.support-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.support-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.support-head-name { font-weight: 700; }
.support-head-role { color: var(--ink-3); font-size: 13px; }
.support-ava { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-lo); color: var(--accent); font-size: 11px; font-weight: 700; }
.support-ava-lg { width: 40px; height: 40px; font-size: 14px; }
.support-msgs { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 320px; max-height: calc(100vh - 280px); overflow: auto; padding: 16px; background: var(--surface-2); }
.support-date { align-self: center; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font-size: 12px; }
.support-row { display: flex; align-items: flex-end; gap: 8px; max-width: min(78%, 520px); }
.support-row.mine { align-self: flex-end; }
.support-bubble { padding: 8px 12px 6px; border-radius: 16px 16px 16px 6px; background: var(--surface); border: 1px solid var(--line); }
.support-row.mine .support-bubble { border-radius: 16px 16px 6px 16px; background: var(--accent); color: var(--on-accent); border-color: transparent; }
.support-body { white-space: pre-wrap; line-height: 1.45; }
.support-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; opacity: .7; }
.support-ticks.is-read { opacity: 1; }
.support-empty { margin: auto; color: var(--ink-3); text-align: center; }
.support-compose { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.support-compose input { flex: 1; border: 0; border-radius: 999px; background: var(--surface-2); padding: 12px 16px; color: var(--ink); font: inherit; }
.support-send { width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager-pages { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager-pages a, .pager-pages span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none;
}
.pager-pages a:hover { background: var(--surface-2); }
.pager-pages .is-current { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pager-pages .is-disabled { opacity: .45; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* Два коротких поля рядом даже в узкой карточке — форма не растёт вниз. */
.grid-2-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .grid-2-tight { grid-template-columns: 1fr; } }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
/* Контент + липкая колонка действий. */
.grid-aside { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, 1.65fr) minmax(280px, .95fr); align-items: start; }
.sticky-aside { position: sticky; top: 86px; }

.section { margin-top: var(--s-8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }

.page-head { display: flex; gap: var(--s-5); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-head .display { margin-top: 6px; }
.page-head .lead { margin-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-3); font-weight: 500; }
.back-link:hover { color: var(--ink); text-decoration: none; }

/* ============================================================ ШАПКА */

.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: var(--s-5); height: 66px; }

.logo { display: inline-flex; align-items: baseline; gap: 7px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark {
  font-family: var(--font-display); font-size: 23px; font-weight: 600; letter-spacing: .01em;
  line-height: 1;
}
.logo-mark em { font-style: normal; color: var(--accent); }
.logo-sub { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: var(--s-3); }
.nav a {
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 500;
  padding: 7px 12px; border-radius: var(--r-full);
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-lo); color: var(--accent-ink); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--r-full);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.icon-btn svg { width: 19px; height: 19px; }

.dot-badge {
  position: absolute; top: 2px; right: 1px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff; border: 2px solid var(--surface);
  border-radius: var(--r-full); font-size: 10px; font-weight: 700; line-height: 13px;
  display: flex; align-items: center; justify-content: center;
}

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-full); flex: none;
  background: var(--accent-lo); color: var(--accent-ink);
  font-weight: 600; font-size: 12.5px; letter-spacing: .02em;
}
.avatar-lg { width: 46px; height: 46px; font-size: 15px; }

.burger { display: none; }

/* ---- выпадающие меню ---- */

.menu-host { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  overflow: hidden; z-index: 70;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu-sm { width: 250px; }
.menu-head { display: flex; align-items: center; justify-content: space-between;
             padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); }
.menu-title { font-weight: 600; font-size: var(--t-sm); }
.menu-body { max-height: 62vh; overflow-y: auto; }
.menu-foot { padding: 10px var(--s-4); border-top: 1px solid var(--line); text-align: center; font-size: var(--t-sm); }
.menu-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px var(--s-4); color: var(--ink); border-bottom: 1px solid var(--line);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.unread { background: var(--accent-lo); }
.menu-item.unread:hover { background: color-mix(in srgb, var(--accent-lo) 70%, var(--surface-2)); }
.menu-link { display: block; padding: 9px var(--s-4); color: var(--ink); font-size: var(--t-sm); }
.menu-link:hover { background: var(--surface-2); text-decoration: none; }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ============================================================ КНОПКИ */

.btn {
  --btn-bg: var(--accent); --btn-ink: var(--on-accent); --btn-line: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--btn-line); background: var(--btn-bg); color: var(--btn-ink);
  font: inherit; font-size: var(--t-sm); font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: var(--btn-ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.btn-ghost { --btn-bg: transparent; --btn-ink: var(--ink); --btn-line: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-quiet { --btn-bg: var(--surface-2); --btn-ink: var(--ink); }
.btn-quiet:hover { background: var(--surface-3); filter: none; }
.btn-danger { --btn-bg: var(--danger); }
.btn-lg { padding: 13px 24px; font-size: var(--t-base); }
.btn-sm { padding: 7px 13px; font-size: var(--t-xs); }
.btn-block { width: 100%; }

/* ============================================================ КАРТОЧКИ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-1);
}
.card.support-pane { padding: 0; overflow: hidden; }
.support-pane .card-title { padding: 14px 16px 0; }
.card + .card { margin-top: var(--s-4); }
.support-split > .card { margin-top: 0; }
.card-flat { box-shadow: none; background: transparent; }
.card-tint { background: var(--surface-2); box-shadow: none; }
.card-pad-0 { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
              margin-bottom: var(--s-4); flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }

.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-2); }

.divide > * + * { border-top: 1px solid var(--line); padding-top: var(--s-4); margin-top: var(--s-4); }

/* ---- статистика ---- */

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
        padding: var(--s-4) var(--s-5); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat-value { font-size: 30px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; }
.stat-label { color: var(--ink-3); font-size: var(--t-xs); margin-top: 5px; }
.stat-hero { font-size: clamp(38px, 4vw, 54px); font-weight: 600; letter-spacing: -.03em; }

/* ============================================================ БЕЙДЖИ */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--ink-2);
  font-size: var(--t-xs); font-weight: 600; line-height: 1.35; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-plain::before { display: none; }
.badge-green { background: var(--accent-lo); color: var(--accent-ink); }
.badge-gold  { background: var(--gold-lo);   color: var(--gold); }
.badge-red   { background: var(--danger-lo); color: var(--danger); }
.badge-info  { background: var(--info-lo);   color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--ink-3); }

.tag {
  display: inline-block; padding: 3px 10px; border: 1px solid var(--line);
  border-radius: var(--r-full); font-size: var(--t-xs); color: var(--ink-3); background: transparent;
}
a.tag:hover { border-color: var(--line-2); color: var(--ink); text-decoration: none; }
a.tag.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ============================================================ ФОРМЫ */

label { display: block; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field + .field { margin-top: var(--s-4); }
/* Соседние поля в сетке — одна строка. Отступ .field + .field сдвигал бы вторую колонку вниз. */
.grid > .field {
  display: flex; flex-direction: column; justify-content: flex-end;
  margin: 0;
}
.grid > .field > :where(input, select),
.row > :where(input, select):not([type=file]):not([type=checkbox]):not([type=radio]):not([type=hidden]) {
  height: 44px; padding-top: 0; padding-bottom: 0;
}
.hint { font-size: var(--t-xs); color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.req { color: var(--danger); }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--t-base);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-lo);
}
textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237C8177' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
[disabled] { opacity: .82; cursor: default; }
select[disabled], input[disabled], textarea[disabled] { background: var(--surface-2); }

label.file-pick {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; font-weight: 400; cursor: pointer;
}
.file-pick input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}
.file-pick-tip {
  display: none; position: absolute; left: 12px; bottom: calc(100% + 8px); z-index: 5;
  padding: 6px 10px; border-radius: 8px; background: #1c1f33; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; pointer-events: none;
}
.file-pick-tip::after {
  content: ''; position: absolute; left: 14px; top: 100%;
  border: 5px solid transparent; border-top-color: #1c1f33;
}
.file-pick:hover .file-pick-tip,
.file-pick:focus-within .file-pick-tip { display: block; }
.file-pick.is-set .file-pick-tip { display: none; }
.file-pick-name {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: var(--t-sm); font-weight: 600;
}
.file-pick:focus-within .btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lo); }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400;
         color: var(--ink-2); font-size: var(--t-base); margin-bottom: 0; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* Выбор из списка: карточка-переключатель вместо голого чекбокса. */
.choice-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.choice {
  display: flex; gap: 10px; align-items: flex-start; margin: 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  font-weight: 400; font-size: var(--t-sm); color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--line-2); }
.choice input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-lo); color: var(--ink); }
.choice b { display: block; color: var(--ink); }

.filters { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.filters:has(label) { align-items: flex-end; }
.filters .field { margin: 0; flex: 1 1 180px; min-width: 0; }
.filters select,
.filters input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]),
.filters .btn,
.filters a.btn {
  height: 36px; width: auto; padding: 0 12px;
  border-radius: 8px; font-size: 13px;
}
.filters select { padding-right: 28px; background-position: right 10px center; }
.filters .field select,
.filters .field input { width: 100%; }
.filters .btn,
.filters a.btn { flex: none; }
.search-field { position: relative; flex: 1 1 240px; }
.search-field input { padding-left: 38px; }
.search-field svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
                    width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }


/* ---- Регистрация: выбор роли и пароль ---- */

.intent-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.intent-card {
  position: relative; display: grid; gap: 12px; margin: 0;
  grid-template-columns: auto 1fr auto; align-items: start;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); cursor: pointer; font-weight: 400;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.intent-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.intent-card input { position: absolute; opacity: 0; pointer-events: none; }
.intent-card:has(input:checked) { border-color: var(--accent); background: var(--accent-lo); }
.intent-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.intent-icon {
  width: 34px; height: 34px; border-radius: var(--r-full); flex: none;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
}
.intent-card:has(input:checked) .intent-icon { background: var(--accent); color: var(--on-accent); }
.intent-body { display: grid; gap: 4px; min-width: 0; }
.intent-body b { font-size: var(--t-base); color: var(--ink); }
.intent-lead { font-size: var(--t-sm); color: var(--ink-3); line-height: 1.45; }
.intent-badge { justify-self: start; margin-top: 2px; }
.intent-check {
  width: 22px; height: 22px; border-radius: var(--r-full); flex: none;
  display: grid; place-items: center; border: 1px solid var(--line-2); color: transparent;
}
.intent-card:has(input:checked) .intent-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 92px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--surface-2); border: none; border-radius: var(--r-xs);
  padding: 6px 10px; font: inherit; font-size: var(--t-xs); font-weight: 600;
  color: var(--ink-2); cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-3); color: var(--ink); }

/* ============================================================ СООБЩЕНИЯ */

.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: var(--t-sm); line-height: 1.5;
  border: 1px solid transparent; margin-bottom: var(--s-5);
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-ok   { background: var(--accent-lo); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.alert-err  { background: var(--danger-lo); color: var(--danger);     border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info { background: var(--info-lo);   color: var(--info);       border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert ul { margin: 0; padding-left: 18px; }

.empty { text-align: center; padding: var(--s-7) var(--s-5); color: var(--ink-3); }
.empty-icon { width: 44px; height: 44px; margin: 0 auto var(--s-3);
              display: grid; place-items: center; border-radius: var(--r-full);
              background: var(--surface-2); color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* Всплывающее сообщение автосохранения. */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px);
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: var(--r-full); box-shadow: var(--shadow-3);
  font-size: var(--t-sm); font-weight: 500; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.toast-card {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  display: flex; align-items: flex-start; gap: 12px;
  width: min(380px, calc(100vw - 32px));
  padding: 14px 14px 14px 16px; border-radius: 16px;
  background: #1c1f33; color: #fff; box-shadow: 0 16px 40px rgba(16, 18, 32, .28);
}
.toast-card-icon { font-size: 18px; line-height: 1.2; }
.toast-card b { display: block; font-size: 15px; font-weight: 700; }
.toast-card p { margin: 4px 0 0; color: rgba(255, 255, 255, .72); font-size: 13px; line-height: 1.45; }
.toast-card button {
  margin-left: auto; border: 0; background: transparent; color: rgba(255, 255, 255, .7);
  cursor: pointer; padding: 0; line-height: 0;
}

/* ============================================================ ТАБЛИЦЫ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.card .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2); color: var(--ink-3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td:has(.row-actions) { vertical-align: middle; }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.row-actions form { margin: 0; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }
.table-plain thead th { position: static; background: transparent; }
.table-compact { table-layout: fixed; }
/* Заголовки переносятся: иначе длинное название бренда распирает таблицу
   и последняя колонка уезжает за край карточки. */
.table-compact th { white-space: normal; padding: 8px 10px; line-height: 1.3; }
.table-compact td { padding: 8px 10px; }
.table-compact th:first-child, .table-compact td:first-child { width: 22%; }
.table-key th { width: 42%; color: var(--ink-3); font-weight: 500; text-transform: none;
                letter-spacing: 0; font-size: var(--t-sm); background: transparent; position: static; }

/* ============================================================ ПРОГРЕСС И ГРАФИКИ */

.progress { height: 6px; background: var(--viz-track); border-radius: var(--r-full); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--viz-3); border-radius: var(--r-full);
              transition: width .35s ease; }
.progress-lg { height: 9px; }

/* Кольцо прогресса на вкладке анкеты. */
.ring { --p: 0; width: 20px; height: 20px; border-radius: 50%; flex: none;
        background: conic-gradient(var(--viz-3) calc(var(--p) * 1%), var(--viz-track) 0); }
.ring::after { content: ''; display: block; width: 12px; height: 12px; margin: 4px;
               border-radius: 50%; background: var(--surface); }
.ring.done { background: var(--viz-3); }
.ring.done::after { background: var(--viz-3); }

/*
 * Полосчатая диаграмма: одна серия магнитуды, столбик растёт от общей базы,
 * значение подписано у кончика, выделенный бренд — акцентом, остальные тише.
 */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(84px, 27%) 1fr auto; gap: 12px; align-items: center; }
.bar-name { font-size: var(--t-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.bar-track { height: 22px; background: var(--viz-track); border-radius: var(--r-xs); overflow: hidden; }
.bar-fill  { display: block; height: 100%; background: var(--viz-mute);
             border-radius: 0 4px 4px 0; transition: width .4s ease; min-width: 2px; }
.bar-row.is-primary .bar-fill { background: var(--viz-3); }
.bar-row.is-primary .bar-name { color: var(--ink); font-weight: 600; }
.bar-value { font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.bar-rank  { font-size: var(--t-xs); color: var(--ink-3); }
.bars-compact .bar-row { grid-template-columns: 1fr auto; }
.bars-compact .bar-name { grid-column: 1 / -1; margin-bottom: 2px; }
.bars-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-4);
              margin-top: 8px; font-variant-numeric: tabular-nums; }

/* Небольшие полосы в ячейке таблицы — профиль по трекам. */
.cell-bar { display: flex; align-items: center; gap: 8px; }
.cell-bar-track { flex: 1 1 auto; height: 6px; min-width: 32px; background: var(--viz-track); border-radius: var(--r-full); }
.cell-bar-fill { display: block; height: 100%; background: var(--viz-2); border-radius: var(--r-full); }

/* ============================================================ КАРТОЧКА КЕЙСА */

.case-card { display: flex; flex-direction: column; gap: 11px; height: 100%; position: relative; }

/* Карточка кейса в админке: раскладка как в CXO, цвета VOE. */
.case-edit { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.case-edit .form-card { padding: 26px; }
.case-edit .field { margin: 0 0 16px; }
.case-edit .field + .field { margin-top: 0; }
.case-edit .field > label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.case-edit .field input:not([type=checkbox]),
.case-edit .field select,
.case-edit .field textarea {
  padding: 10px 13px; border-radius: var(--r-md); font-size: 14px; line-height: 1.5;
}
.case-edit .field select { height: auto; padding-right: 34px; }
.case-edit .field textarea { min-height: 72px; resize: vertical; }
.case-edit .hint { margin-top: 5px; font-size: 11px; line-height: 1.5; }
.case-edit .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.case-edit .field-row .field { margin-bottom: 0; }
.case-edit .section-title { margin: 26px 0 12px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.case-edit .section-title:first-child { margin-top: 0; }
.case-edit .form-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.case-edit .preview-wrap { position: sticky; top: 24px; }
.case-edit .preview-label { margin-bottom: 10px; color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.case-edit .tile { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.case-edit .tile-body { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; }
.case-edit .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.case-edit .tile-date { color: var(--ink-3); font-size: 11px; }
.case-edit .tile-title { color: var(--ink); font-size: 17px; font-weight: 500; line-height: 1.3; }
.case-edit .tile-lead { margin-top: 6px; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.case-edit .tile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.case-edit .tile-tags span { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: var(--r-full); background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.case-edit .tile-tags .is-accent { background: var(--accent-lo); color: var(--accent-ink); }
.case-edit .tile-foot { display: flex; gap: 18px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.case-edit .tile-meta-label { color: var(--ink-3); font-size: 9px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.case-edit .tile-meta-val { margin-top: 3px; color: var(--ink); font-size: 12px; }
.case-edit .tile-meta-val .soft { color: var(--ink-3); font-weight: 400; }
.case-edit .tile-meta-val .urgent { color: var(--accent); font-weight: 500; }
@media (max-width: 1100px) { .case-edit { grid-template-columns: 1fr; } .case-edit .preview-wrap { position: static; } }
@media (max-width: 620px) { .case-edit .field-row { grid-template-columns: 1fr; } .case-edit .field-row .field + .field { margin-top: 16px; } }
.case-card h3 { font-size: var(--t-lg); line-height: 1.3; letter-spacing: -.01em; }
.case-card h3 a { color: inherit; }
.case-card h3 a:hover { color: var(--accent); text-decoration: none; }
.case-card .lead { font-size: var(--t-sm); color: var(--ink-3); }
.case-foot { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--line);
             display: flex; gap: 10px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.case-foot .dot { color: var(--ink-4); }

/* ============================================================ ЛЕНДИНГ */

.hero { padding: var(--s-8) 0 var(--s-7); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: var(--s-4);
                color: var(--ink-3); font-size: var(--t-xs); font-weight: 600;
                letter-spacing: .1em; text-transform: uppercase; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 60ch; margin-top: var(--s-4); font-size: var(--t-lg); }
.hero-actions { margin-top: var(--s-6); }

.role-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.role-card .badge { align-self: flex-start; }
.role-card h3 { font-size: var(--t-lg); }
.role-card p { color: var(--ink-3); font-size: var(--t-sm); }
.role-card .role-link { margin-top: auto; padding-top: var(--s-3); font-weight: 600; font-size: var(--t-sm); }

.steps { counter-reset: step; display: grid; gap: var(--s-4); }
.step { display: flex; gap: var(--s-4); align-items: flex-start; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 30px; height: 30px; flex: none; border-radius: var(--r-full);
  background: var(--accent-lo); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 600; font-size: var(--t-sm);
}

/* ============================================================ АНКЕТА */

.form-shell { position: relative; margin-top: 16px; }
.form-shell .panel.active:not([data-panel-body="__terms"]) { display: flex; flex-direction: column; gap: 16px; }
.form-shell .panel .card { margin: 0; }
.track-head { display: flex; align-items: center; gap: 10px; }
.track-head i { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 7px; background: rgba(53, 71, 176, .1); color: #3547b0; font-style: normal; font-size: 12px; font-weight: 700; }
.track-head b { color: #15172e; font-size: clamp(15px, 0.25vw + 14px, 16px); font-weight: 700; }
.track-head span { color: rgba(21, 23, 46, .5); font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.track-table { padding: 4px 16px 8px; overflow: visible; }
.track-cols { display: none; }
.track-table .crit { display: block; margin: 0; padding: 16px 0; border-top: 1px solid rgba(21, 23, 46, .07); }
.track-table .crit:first-of-type { border-top: 0; }
.track-table .crit-head { justify-content: flex-start; margin: 0 0 8px; }
.crit-help { position: relative; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: rgba(21, 23, 46, .4); cursor: help; outline: none; }
.crit-help:hover, .crit-help:focus-visible { background: rgba(53, 71, 176, .1); color: #3547b0; }
.crit-tip { display: none; position: absolute; z-index: 6; left: 0; top: calc(100% + 6px); width: min(340px, 70vw); padding: 10px 12px; border-radius: 10px; background: #15172e; color: #fff; font-size: 13px; font-weight: 500; line-height: 1.45; }
.crit-help:hover .crit-tip, .crit-help:focus-visible .crit-tip { display: block; }
.track-table .score-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--svc, 4), minmax(0, 1fr)); }
.track-table .score-cell { display: block; padding: 12px; background: #f7f4ee; border-radius: 12px; }
.track-table .score-brand { display: flex; margin: 0 0 8px; font-size: 13px; }
.track-table .scale { display: flex; gap: 6px; width: auto; }
.track-table .scale label { flex: 1 1 0; min-width: 28px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 14px; }
.track-table .crit-extra { display: grid; grid-column: 1 / -1; grid-template-columns: 200px 1fr; gap: 12px; margin-top: 8px; }
.track-table .crit-extra label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.track-table .crit-extra .prof-wide { grid-column: 1 / -1; }
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sum-grid article { padding: 16px; border: 1px solid rgba(21, 23, 46, .07); border-radius: 16px; background: #fff; }
.sum-grid header, .sum-grid p { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; }
.sum-grid header { margin-bottom: 10px; }
.sum-grid header b { color: #15172e; font-size: clamp(14px, 0.2vw + 13px, 15px); }
.sum-grid header em { color: #c93f1c; font-style: normal; font-size: 18px; font-weight: 700; }
.sum-grid p { padding: 6px 0; color: rgba(21, 23, 46, .7); font-size: 13px; }
.sum-grid p b { color: #15172e; }
.sum-grid .is-total { margin-top: 6px; padding-top: 8px; border-top: 1px solid rgba(21, 23, 46, .08); font-weight: 700; }
.sum-grid small { display: block; margin-top: 8px; color: rgba(21, 23, 46, .55); font-size: 12px; line-height: 1.4; }
html[data-theme="dark"] .sum-grid article { background: #1e2142; }
html[data-theme="dark"] .sum-grid header b,
html[data-theme="dark"] .sum-grid p b { color: #fff; }
html[data-theme="dark"] .track-table .score-cell { background: rgba(251, 247, 241, .06); }
html[data-theme="dark"] .crit-help { color: rgba(251, 247, 241, .55); }

/* Карточка анкеты в админке: размеры как в CXO, цвета — токены VOE. */
.vr-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.vr-kicker { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.vr-name { font-size: 26px; font-weight: 700; letter-spacing: -.3px; line-height: 1.15; color: var(--ink); }
.vr-case { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.vr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vr-actions form { margin: 0; }
.vr-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; padding: 0; }
.vr-meta > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.vr-meta > div:last-child { border-right: none; }
.vr-meta-key { font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.vr-meta-val { font-size: 13px; color: var(--ink); font-weight: 500; }
.vr-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; background: var(--accent-lo); color: var(--accent-ink); }
.vr-chip.is-muted { background: var(--surface-2); color: var(--ink-2); }
.vr-section { margin-top: 26px; }
.vr-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.vr-num { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--accent-ink); background: var(--accent-lo); padding: 3px 8px; border-radius: var(--r-sm); }
.vr-title { font-size: 17px; font-weight: 500; color: var(--ink); }
.vr-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; max-width: 900px; line-height: 1.5; }
.vr-card { overflow-x: auto; }
table.vr-table { font-size: 13px; }
table.vr-table thead th { position: static; padding: 12px 14px; font-size: 11px; letter-spacing: .05em; }
table.vr-table tbody td { padding: 12px 14px; vertical-align: middle; color: var(--ink-2); }
table.vr-table thead th.crit { text-align: left; min-width: 280px; }
table.vr-table thead th.serv { text-align: center; min-width: 92px; }
table.vr-table thead th.serv.is-main { color: var(--accent); }
table.vr-table thead th.cmt { text-align: left; min-width: 240px; }
table.vr-table td.score { text-align: center; font-variant-numeric: tabular-nums; }
table.vr-table td.score b { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; padding: 2px 6px; border-radius: var(--r-sm); background: var(--accent-lo); color: var(--accent-ink); font-size: 12px; }
table.vr-table td.score span.na { color: var(--ink-4); }
table.vr-table td.cmt { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.vr-empty { color: var(--ink-4); }
.vr-text-row { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.vr-text-row:last-child { border-bottom: none; }
.vr-text-label { font-size: 12px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.vr-text-val { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; }
.anketa-head { margin-top: 8px; padding: 20px 22px 0; background: #fff; border: 1px solid rgba(21, 23, 46, .07); border-radius: 22px; }
.anketa-head-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.anketa-head h1 { margin: 6px 0 0; max-width: 18em; color: #15172e; font-size: clamp(18px, 0.6vw + 14px, 22px); font-weight: 400; line-height: 1.3; }
.anketa-progress { min-width: 180px; text-align: right; }
.anketa-progress span, .anketa-progress small { display: block; color: rgba(21, 23, 46, .5); font-size: 12px; }
.anketa-bar { height: 6px; margin: 8px 0; border-radius: 3px; background: #f1ece3; overflow: hidden; }
.anketa-bar i { display: block; height: 6px; border-radius: 3px; background: #2fb88c; }
.anketa-progress em { display: inline-flex; margin-top: 6px; padding: 4px 10px; border-radius: 100px; background: rgba(47, 184, 140, .14); color: #1f8264; font-size: 12px; font-style: normal; font-weight: 700; }
.anketa-tabs { margin: 16px -22px 0; padding: 0 12px; border-bottom: 0; gap: 0; flex-wrap: nowrap; overflow-x: auto; }
.anketa-tabs .tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; margin: 0; padding: 12px 14px; color: rgba(21, 23, 46, .5); white-space: nowrap; font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.anketa-tabs .tab.active { border-color: #f2542d; color: #c93f1c; background: none; }
.anketa-tabs .tab-count { padding: 1px 6px; border-radius: 20px; background: rgba(21, 23, 46, .06); font-size: 10px; }
.anketa-rules { padding: 16px 18px; border: 1px solid rgba(201, 150, 47, .28); border-radius: 14px; background: rgba(201, 150, 47, .1); color: #8f6c1e; }
.anketa-rules p { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.anketa-rules span { display: block; margin-top: 6px; font-size: clamp(13px, 0.15vw + 12px, 14px); line-height: 1.45; }
.form-shell h2 { display: flex; align-items: center; gap: 10px; margin: 22px 0 6px; color: #15172e; font-size: clamp(15px, 0.25vw + 14px, 16px); }
.form-shell h2 i { display: inline-grid; place-items: center; min-width: 28px; height: 22px; padding: 0 6px; border-radius: 7px; background: rgba(53, 71, 176, .1); color: #3547b0; font-style: normal; font-size: 12px; }
.anketa-lead { margin: 0 0 12px; color: rgba(21, 23, 46, .5); font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.anketa-facts, .anketa-scale { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.anketa-facts div, .anketa-scale b { background: #f1ece3; border-radius: 14px; }
.anketa-facts div { padding: 14px 16px; }
.anketa-facts span, .anketa-scale span { display: block; color: rgba(21, 23, 46, .5); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.anketa-facts b { display: block; margin-top: 6px; color: #15172e; font-size: clamp(13px, 0.15vw + 12px, 14px); background: none; }
.anketa-scale { margin-top: 8px; }
.anketa-scale div { display: flex; align-items: center; gap: 10px; }
.anketa-scale b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #15172e; font-size: 12px; }
.anketa-scale span { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: clamp(12px, 0.15vw + 11px, 13px); }
html[data-theme="dark"] .anketa-head,
html[data-theme="dark"] .form-shell .card { background: #1e2142; }
html[data-theme="dark"] .anketa-head h1,
html[data-theme="dark"] .form-shell h2,
html[data-theme="dark"] .anketa-facts b { color: #fff; }
html[data-theme="dark"] .anketa-facts div,
html[data-theme="dark"] .anketa-scale b { background: rgba(251, 247, 241, .06); }
html[data-theme="dark"] .anketa-tabs .tab { color: rgba(251, 247, 241, .55); }
html[data-theme="dark"] .anketa-tabs .tab.active { color: #ff8562; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--s-5);
        border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 15px; border: 1px solid transparent; border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  background: transparent; color: var(--ink-3); cursor: pointer;
  font: inherit; font-size: var(--t-sm); font-weight: 600;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { background: var(--surface); border-color: var(--line); color: var(--ink); margin-bottom: -1px; }
.tab-count { font-weight: 500; color: var(--ink-4); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.tab.done .tab-count { color: var(--accent); }

.panel { display: none; }
.panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.crit { border-top: 1px solid var(--line); padding: var(--s-4) 0; }
.crit:first-of-type { border-top: none; padding-top: var(--s-2); }
.crit-head { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: 12px; }
.crit-text { flex: 1 1 auto; font-size: var(--t-base); line-height: 1.5; }
.crit-state { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 7px;
              background: var(--line-2); transition: background .2s; }
.crit.is-filled .crit-state { background: var(--viz-3); }

.score-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.score-cell { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.score-brand { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); margin-bottom: 7px;
               display: flex; justify-content: space-between; gap: 6px; }

/* Сегментированный переключатель балла вместо выпадающего списка:
   один клик вместо трёх и вся шкала на виду. */
.scale { display: flex; gap: 4px; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale label {
  flex: 1 1 0; margin: 0; text-align: center; cursor: pointer;
  padding: 7px 0; border-radius: var(--r-xs);
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  transition: background .12s, color .12s, border-color .12s;
}
.scale label:hover { border-color: var(--accent); color: var(--ink); }
.scale input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.scale input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-na input:checked + label { background: var(--ink-3); border-color: var(--ink-3); }
.scale.is-readonly label { cursor: default; }

.crit-extra { display: grid; gap: var(--s-3); grid-template-columns: 200px 1fr; margin-top: var(--s-3); }
.crit-extra textarea { min-height: 62px; font-size: var(--t-sm); }

.scale-legend { display: grid; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); }
.scale-legend div { display: flex; gap: 10px; }
.scale-legend b { flex: none; width: 18px; color: var(--ink); }

.actionbar {
  position: sticky; bottom: 0; z-index: 30; margin-top: var(--s-6);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px 18px; box-shadow: var(--shadow-2);
  display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap;
}
.actionbar .progress { flex: 1 1 160px; min-width: 120px; }
.save-state { font-size: var(--t-xs); color: var(--ink-3); }

/* ============================================================ ОПОВЕЩЕНИЯ */

.notice { display: flex; gap: 12px; padding: 15px var(--s-5); border-bottom: 1px solid var(--line); color: inherit; }
.notice:last-child { border-bottom: none; }
.notice:hover { background: var(--surface-2); text-decoration: none; }
.notice.unread { background: var(--accent-lo); }
.notice-title { font-weight: 600; }
.notice-time { color: var(--ink-3); font-size: var(--t-xs); margin-top: 3px; }
.notice-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; }

/* Лента событий заявки/кейса. */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: var(--s-4); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px;
                         border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.timeline-item.done::before { background: var(--accent); border-color: var(--accent); }
.timeline-item.current::before { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-lo); }

/* Цитата эксперта. */
.quote { border-left: 3px solid var(--accent-lo); padding: 2px 0 2px 14px; }
.quote p { font-family: var(--font-display); font-size: var(--t-md); line-height: 1.55; color: var(--ink); }
.quote-by { margin-top: 6px; font-size: var(--t-xs); color: var(--ink-3); }

/* ============================================================ ВХОД И РЕГИСТРАЦИЯ */

.gate {
  --gate-bg: #f1ece3;
  --gate-card: #fff;
  --gate-ink: #15172e;
  --gate-muted: rgba(21, 23, 46, .7);
  --gate-faint: rgba(21, 23, 46, .5);
  --gate-line: rgba(21, 23, 46, .12);
  --gate-card-line: rgba(21, 23, 46, .07);
  --gate-input: #f1ece3;
  --gate-accent: #c93f1c;
  --gate-btn: #f2542d;
  --gate-tab: #f1ece3;
  --gate-tab-on: #15172e;
  position: relative;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 28px);
  padding: clamp(56px, 8vw, 72px) clamp(16px, 4vw, 20px) clamp(24px, 5vw, 48px);
  background:
    radial-gradient(circle at 84% 88%, rgba(242, 84, 45, .07), transparent 22%),
    radial-gradient(circle at 18% 12%, rgba(53, 71, 176, .07), transparent 22%),
    var(--gate-bg);
  overflow: auto;
}
html[data-theme="dark"] .gate {
  --gate-bg: #15172e;
  --gate-card: #1e2142;
  --gate-ink: #fff;
  --gate-muted: rgba(251, 247, 241, .72);
  --gate-faint: rgba(251, 247, 241, .5);
  --gate-line: rgba(251, 247, 241, .12);
  --gate-card-line: rgba(251, 247, 241, .08);
  --gate-input: rgba(251, 247, 241, .05);
  --gate-accent: #ff8562;
  --gate-btn: #f2542d;
  --gate-tab: rgba(251, 247, 241, .06);
  --gate-tab-on: #f2542d;
  background: linear-gradient(140deg, #15172e 29%, #3a2318 104%);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .gate {
    --gate-bg: #15172e;
    --gate-card: #1e2142;
    --gate-ink: #fff;
    --gate-muted: rgba(251, 247, 241, .72);
    --gate-faint: rgba(251, 247, 241, .5);
    --gate-line: rgba(251, 247, 241, .12);
    --gate-card-line: rgba(251, 247, 241, .08);
    --gate-input: rgba(251, 247, 241, .05);
    --gate-accent: #ff8562;
    --gate-btn: #f2542d;
    --gate-tab: rgba(251, 247, 241, .06);
    --gate-tab-on: #f2542d;
    background: linear-gradient(140deg, #15172e 29%, #3a2318 104%);
  }
}
.gate-theme {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gate-card); color: var(--gate-ink);
  border: 1px solid var(--gate-card-line); cursor: pointer;
}
.gate-logo { display: block; }
.gate-logo img { height: clamp(42px, 6vw, 53px); width: auto; }
.gate-logo .gate-logo-light { display: block; }
.gate-logo .gate-logo-dark { display: none; }
html[data-theme="dark"] .gate-logo .gate-logo-light { display: none; }
html[data-theme="dark"] .gate-logo .gate-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .gate-logo .gate-logo-light { display: none; }
  html:not([data-theme="light"]) .gate-logo .gate-logo-dark { display: block; }
}
.gate-card {
  width: min(460px, 100%);
  padding: clamp(22px, 3vw, 34px) clamp(16px, 4vw, 32px) clamp(20px, 2.5vw, 28px);
  background: var(--gate-card);
  border: 1px solid var(--gate-card-line);
  border-radius: clamp(16px, 2vw, 22px);
  color: var(--gate-ink);
}
.gate-pane[hidden] { display: none; }
.gate-kicker {
  margin: 0 0 8px; color: var(--gate-accent);
  font-size: clamp(10px, 0.15vw + 9.5px, 11px); font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
}
.gate-title {
  margin: 0; font-family: var(--font-ui); font-size: clamp(18px, 0.4vw + 16px, 22px); font-weight: 700;
  letter-spacing: -.01em; line-height: 1.35; color: var(--gate-ink);
}
.gate-lead { margin: 6px 0 18px; color: var(--gate-muted); font-size: clamp(13px, 0.2vw + 12px, 15px); line-height: 1.45; }
.gate-title + .gate-row,
.gate-title + .gate-field { margin-top: 18px; }
.gate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gate-field { margin-top: 14px; }
.gate-row .gate-field { display: flex; flex-direction: column; justify-content: flex-end; margin-top: 0; }
.gate-field label { margin-bottom: 6px; color: var(--gate-muted); font-size: clamp(12px, 0.15vw + 11.5px, 13px); font-weight: 700; }
.gate-field .req { color: var(--gate-accent); }
.gate-card input, .gate-card select {
  height: clamp(44px, 2vw, 48px); padding: 0 14px; border-radius: 14px;
  border: 1px solid var(--gate-line); background: var(--gate-input); color: var(--gate-ink);
  font-size: clamp(16px, 0.25vw + 14px, 17px);
}
.gate-card input:focus, .gate-card select:focus {
  border-color: var(--gate-btn); box-shadow: 0 0 0 3px rgba(242, 84, 45, .16);
}
.gate-card select {
  background-color: var(--gate-input);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2315172e' stroke-opacity='.7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .gate-card select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23fbf7f1' stroke-opacity='.72' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.gate-pw { position: relative; }
.gate-pw input { padding-right: 40px; }
.gate-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer;
}
.gate-eye .eye-dark { display: none; }
html[data-theme="dark"] .gate-eye .eye-light { display: none; }
html[data-theme="dark"] .gate-eye .eye-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .gate-eye .eye-light { display: none; }
  html:not([data-theme="light"]) .gate-eye .eye-dark { display: block; }
}
.gate-forgot { margin: 8px 0 16px; text-align: right; }
.gate-forgot a, .gate-card button.linkish { color: var(--gate-accent); font-weight: 700; font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.gate-submit, .gate-card .btn {
  width: 100%; height: clamp(44px, 2vw, 48px); margin-top: 8px; border: 0; border-radius: 10px;
  background: var(--gate-btn); color: #fff; font: inherit; font-size: clamp(14px, 0.2vw + 13px, 16px); font-weight: 700; cursor: pointer;
}
.gate-switch { margin: 16px 0 0; text-align: center; color: var(--gate-faint); font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.gate-docs {
  margin: 14px 0 0; text-align: center; color: var(--gate-faint); font-size: clamp(11px, 0.15vw + 10.5px, 12.5px); line-height: 1.5;
}
.gate-docs a { color: var(--gate-muted); font-weight: 700; }
.gate-legal { margin: 16px 0 12px; color: var(--gate-faint); font-size: clamp(11px, 0.15vw + 10.5px, 12.5px); line-height: 1.45; }
.gate-legal a { color: var(--gate-muted); font-weight: 700; }
button.linkish { background: none; border: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
button.linkish:hover { text-decoration: underline; }
.gate-card .display { font-family: var(--font-ui); font-size: clamp(18px, 0.4vw + 16px, 22px); font-weight: 700; color: var(--gate-ink); }
.gate-card .lead { color: var(--gate-muted); font-size: clamp(13px, 0.2vw + 12px, 15px); }
@media (max-width: 520px) {
  .gate-row { grid-template-columns: 1fr; gap: 14px; }
}

/* ============================================================ ПОДВАЛ */

.site-footer { border-top: 1px solid var(--line); padding: var(--s-6) 0; margin-top: var(--s-8);
               color: var(--ink-3); font-size: var(--t-sm); background: var(--surface); }
.site-footer a { color: var(--ink-2); }

/* ============================================================ АДАПТИВ */

@media (max-width: 1080px) {
  .grid-aside { grid-template-columns: 1fr; }
  .sticky-aside { position: static; }
}

@media (max-width: 860px) {
  .wrap { padding: 0 var(--s-4); }
  .topbar-inner { height: 58px; }
  .burger { display: inline-flex; }
  .nav {
    position: fixed; inset: 58px 0 auto 0; flex-direction: column; align-items: stretch;
    gap: 0; margin: 0; padding: var(--s-3);
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2); display: none; z-index: 65;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: var(--r-sm); font-size: var(--t-base); }
  .logo-sub { display: none; }

  .crit-extra { grid-template-columns: 1fr; }


  .bar-row { grid-template-columns: 1fr auto; }
  .bar-name { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Личный кабинет: боковое меню и главная. */
.desk-body { margin: 0; min-height: 100vh; background: #F1ECE3; color: #15172e; }
.desk-side {
  position: fixed; inset: 0 auto 0 0; width: 250px; height: 100vh;
  background: #fff; border-right: 1px solid rgba(21, 23, 46, .07);
  display: flex; flex-direction: column; z-index: 40;
}
.desk-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 33px 18px 0; }
.desk-logo img { display: block; height: auto; }
.desk-logo-dark { display: none; }
.desk-nav { display: flex; flex-direction: column; gap: 3px; margin: 36px 18px 0; }
.desk-nav a, .desk-nav .desk-group-toggle {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 12px;
  background: none; color: rgba(21, 23, 46, .7); font: inherit;
  font-size: clamp(12px, 0.2vw + 11.5px, 13px); font-weight: 700; text-align: left;
  text-decoration: none; cursor: pointer;
}
.desk-group-toggle svg { margin-left: auto; transform: rotate(-90deg); transition: transform .15s ease; }
.desk-group.is-open .desk-group-toggle svg { transform: none; }
.desk-sub { display: none; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 14px; }
.desk-group.is-open .desk-sub { display: flex; }
.desk-sub a { min-height: 36px; font-weight: 600; }
.desk-count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 20px;
  background: rgba(242, 84, 45, .12); color: #c93f1c; font-size: 11px; line-height: 18px; text-align: center;
}
.desk-nav a img, .desk-nav a .ico { display: block; flex: none; }
.desk-nav a img { filter: brightness(0); opacity: .55; }
.desk-nav a .ico { color: inherit; }
.desk-nav a:hover, .desk-nav .desk-group-toggle:hover { background: rgba(21, 23, 46, .05); color: #15172e; }
.desk-nav a.active { background: rgba(21, 23, 46, .06); color: #15172e; }
.desk-nav a.active::before {
  content: ""; position: absolute; left: -18px; top: 12px; width: 3px; height: 18px;
  background: #f2542d; border-radius: 0 3px 3px 0;
}
.desk-user { margin-top: auto; padding: 16px 18px 0; border-top: 1px solid rgba(21, 23, 46, .08); }
.desk-user a { display: flex; align-items: center; gap: 10px; color: #15172e; text-decoration: none; }
.desk-user span:first-child {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50px; flex: none;
  background: linear-gradient(135deg, #3547b0, #f2542d); font-size: 13px; font-weight: 700;
}
.desk-user b, .desk-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-user a > span:last-child { min-width: 0; }
.desk-user b { font-size: clamp(12px, 0.2vw + 11.5px, 13px); font-weight: 700; }
.desk-user small { margin-top: 2px; color: rgba(21, 23, 46, .5); font-size: clamp(11px, 0.15vw + 10.5px, 12px); }
.desk-foot { padding: 12px 8px 16px; }
.desk-foot a, .desk-foot button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 35px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; color: rgba(21, 23, 46, .5);
  font: inherit; font-size: clamp(11px, 0.15vw + 10.5px, 12px); font-weight: 700; text-align: left; cursor: pointer; text-decoration: none;
}
.desk-foot a img, .desk-foot button img { filter: brightness(0); opacity: .45; }
.desk-foot a:hover, .desk-foot button:hover { background: rgba(21, 23, 46, .05); color: #15172e; }
.desk-main { margin-left: 250px; padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 48px) clamp(24px, 4vw, 48px); }
.desk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.desk-kicker { margin: 0; color: rgba(21, 23, 46, .5); font-size: clamp(10px, 0.15vw + 9.5px, 11px); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.desk-head h1 { margin: 6px 0 0; font-size: clamp(20px, 0.8vw + 16px, 25px); font-weight: 700; letter-spacing: -.26px; line-height: 1.2; }
.desk-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 14px); margin-top: clamp(18px, 2vw, 28px); }
.desk-stat {
  display: flex; align-items: center; gap: 14px; min-height: clamp(64px, 6vw, 74px); padding: 16px 18px;
  background: #fff; border: 1px solid rgba(21, 23, 46, .07); border-radius: 14px;
  color: rgba(21, 23, 46, .7); font-size: clamp(12px, 0.2vw + 11px, 13px); text-decoration: none;
}
.desk-stat b { color: #15172e; font-size: clamp(13px, 0.25vw + 12px, 14px); }
.desk-stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.desk-stat-icon img { display: block; }
.desk-stat-icon--orange { background: rgba(242, 84, 45, .1); }
.desk-stat-icon--blue { background: rgba(53, 71, 176, .1); }
.desk-stat-icon--green { background: rgba(47, 184, 140, .12); }
.desk-stat-icon--gold { background: rgba(201, 150, 47, .12); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(18px, 2vw, 28px); align-items: start; }
.desk-card { background: #fff; border: 1px solid rgba(21, 23, 46, .07); border-radius: clamp(16px, 1.5vw, 22px); padding: clamp(16px, 2vw, 24px) clamp(16px, 2vw, 26px) 8px; }
.desk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.desk-card-head h2 { margin: 0; color: rgba(21, 23, 46, .5); font-size: clamp(11px, 0.15vw + 10.5px, 12px); font-weight: 700; letter-spacing: .06em; }
.desk-card-head a { color: #c93f1c; font-size: clamp(12px, 0.15vw + 11.5px, 13px); font-weight: 700; text-decoration: none; white-space: nowrap; }
.desk-row, .desk-news { display: block; padding: 13px 0; border-bottom: 1px solid rgba(21, 23, 46, .07); color: inherit; text-decoration: none; }
.desk-row:last-child, .desk-news:last-child { border-bottom: 0; }
.desk-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.desk-row b, .desk-news h3 { display: block; color: #15172e; font-size: clamp(14px, 0.25vw + 13px, 15px); font-weight: 700; line-height: 1.35; }
.desk-row small, .desk-empty { display: block; margin-top: 4px; color: rgba(21, 23, 46, .5); font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.desk-row em { flex: none; color: #c93f1c; font-size: clamp(12px, 0.15vw + 11px, 13px); font-style: normal; font-weight: 700; }
.desk-news time { display: block; margin-bottom: 4px; color: rgba(21, 23, 46, .5); font-size: clamp(11px, 0.15vw + 10px, 12px); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.desk-news p { margin: 6px 0 0; color: rgba(21, 23, 46, .7); font-size: clamp(13px, 0.2vw + 12px, 14px); line-height: 1.5; }
.desk-empty { margin: 12px 0 16px; }
.desk-burger { display: none; position: fixed; top: 12px; left: 12px; z-index: 50; background: #fff; }

html[data-theme="dark"] .desk-body { background: #12142b; }
html[data-theme="dark"] .desk-side { background: #15172e; border-right-color: rgba(251, 247, 241, .06); }
html[data-theme="dark"] .desk-logo-light { display: none; }
html[data-theme="dark"] .desk-logo-dark { display: flex; flex-direction: column; align-items: center; gap: 8px; }
html[data-theme="dark"] .desk-nav a,
html[data-theme="dark"] .desk-nav .desk-group-toggle { color: rgba(251, 247, 241, .7); }
html[data-theme="dark"] .desk-nav a img,
html[data-theme="dark"] .desk-foot a img,
html[data-theme="dark"] .desk-foot button img { filter: none; opacity: 1; }
html[data-theme="dark"] .desk-nav a:hover,
html[data-theme="dark"] .desk-nav .desk-group-toggle:hover { background: rgba(251, 247, 241, .06); color: #fff; }
html[data-theme="dark"] .desk-nav a.active { background: rgba(251, 247, 241, .08); color: #fff; }
html[data-theme="dark"] .desk-user { border-top-color: rgba(251, 247, 241, .08); }
html[data-theme="dark"] .desk-user a,
html[data-theme="dark"] .desk-user b { color: #fff; }
html[data-theme="dark"] .desk-user small,
html[data-theme="dark"] .desk-foot a,
html[data-theme="dark"] .desk-foot button { color: rgba(251, 247, 241, .5); }
html[data-theme="dark"] .desk-foot a:hover,
html[data-theme="dark"] .desk-foot button:hover { background: rgba(251, 247, 241, .06); color: #fff; }
html[data-theme="dark"] .desk-burger { background: #1e2142; color: #fff; }
html[data-theme="dark"] .desk-stat,
html[data-theme="dark"] .desk-card { background: #1e2142; border-color: rgba(251, 247, 241, .08); }
html[data-theme="dark"] .desk-kicker,
html[data-theme="dark"] .desk-card-head h2,
html[data-theme="dark"] .desk-row small,
html[data-theme="dark"] .desk-news time,
html[data-theme="dark"] .desk-empty { color: rgba(251, 247, 241, .5); }
html[data-theme="dark"] .desk-head h1,
html[data-theme="dark"] .desk-stat b,
html[data-theme="dark"] .desk-row b,
html[data-theme="dark"] .desk-news h3 { color: #fff; }
html[data-theme="dark"] .desk-stat,
html[data-theme="dark"] .desk-news p { color: rgba(251, 247, 241, .7); }
html[data-theme="dark"] .desk-card-head a,
html[data-theme="dark"] .desk-row em { color: #ff8562; }
html[data-theme="dark"] .desk-row,
html[data-theme="dark"] .desk-news { border-color: rgba(251, 247, 241, .08); }

.prof { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 12px; margin-top: 20px; align-items: start; }
.prof .desk-card { padding: 16px; }
.prof-main { display: flex; flex-direction: column; gap: 12px; }
.prof-main > form { display: flex; flex-direction: column; gap: 12px; }
.prof .desk-card-head { margin-bottom: 12px; }
.prof-id { display: flex; flex-direction: column; gap: 8px; }
.prof-id h2 { margin: 8px 0 0; color: #15172e; font-size: clamp(17px, 0.4vw + 15px, 19px); font-weight: 400; }
.prof-id p { margin: 0; color: rgba(21, 23, 46, .7); font-size: clamp(13px, 0.2vw + 12px, 14px); }
.prof-avatar { position: relative; width: 78px; height: 78px; }
.prof-avatar > span, .prof-avatar > img {
  display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50px; object-fit: cover;
  background: linear-gradient(135deg, #3547b0, #f2542d); color: #fff; font-size: clamp(20px, 0.4vw + 18px, 24px); font-weight: 700;
}
.prof-camera {
  position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50px; background: #fff; border: 1px solid rgba(21, 23, 46, .14); cursor: pointer;
}
.prof-camera input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prof-city { display: flex; align-items: center; gap: 4px; color: rgba(21, 23, 46, .5); font-size: clamp(12px, 0.15vw + 11px, 13px); }
.prof-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.prof-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 12px; border-radius: 100px; font-size: clamp(11px, 0.15vw + 10.5px, 12px); font-weight: 700; }
.prof-badge--ok { background: rgba(47, 184, 140, .12); color: #1f8264; }
.prof-badge--accent { background: rgba(242, 84, 45, .1); color: #c93f1c; }
.prof-edit-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: #c93f1c; font: inherit; font-size: clamp(12px, 0.15vw + 11.5px, 13px); font-weight: 700; cursor: pointer; }
.prof-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.prof-fields > label,
.prof-fields > [data-tag-field] { display: flex; flex-direction: column; justify-content: flex-end; margin-bottom: 0; }
.prof-fields > div span, .prof-label, .prof-fields label { display: block; margin-bottom: 4px; color: rgba(21, 23, 46, .5); font-size: clamp(11px, 0.15vw + 10px, 12px); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.prof-label { margin-top: 12px; }
.prof-fields b { display: block; color: #15172e; font-size: clamp(14px, 0.2vw + 13px, 15px); font-weight: 700; line-height: 1.45; text-transform: none; letter-spacing: 0; }
.prof-fields b.is-empty, .is-empty { color: rgba(21, 23, 46, .5); font-weight: 400; }
.prof-wide { grid-column: 1 / -1; }
.prof-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0; }
.prof-chips span { display: inline-flex; align-items: center; min-height: 31px; padding: 0 14px; border-radius: 100px; background: rgba(53, 71, 176, .09); color: #3547b0; font-size: clamp(12px, 0.15vw + 11.5px, 13px); font-weight: 700; }
.prof-fields input, .prof-fields textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid rgba(21, 23, 46, .12); border-radius: 12px;
  background: #f1ece3; color: #15172e; font: inherit; font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.prof-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.prof-choices label { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: clamp(12px, 0.15vw + 11.5px, 13px); }
.prof-save { align-self: flex-start; margin-top: 0; border: 0; border-radius: 12px; background: #f2542d; color: #fff; font: inherit; font-size: clamp(14px, 0.2vw + 13px, 15px); font-weight: 700; padding: 12px 18px; cursor: pointer; }
.prof-tag-open { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid rgba(21, 23, 46, .12); border-radius: 12px; background: #f1ece3; color: #15172e; font: inherit; font-size: 16px; font-weight: 500; text-align: left; cursor: pointer; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(19, 21, 17, .45); }
.modal[hidden] { display: none; }
.modal-card { width: min(440px, 100%); padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 20px; }
.modal-close { font-size: 22px; }
.modal-text { margin: 12px 0 0; color: var(--ink-2); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.prof-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(21, 23, 46, .45); }
.prof-modal[hidden] { display: none; }
.prof-modal-card { width: min(560px, 100%); padding: 22px; border-radius: 22px; background: #fbf7f1; }
.prof-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.prof-modal-head h2 { margin: 0; color: #15172e; font-size: 20px; font-weight: 700; }
.prof-modal-close { border: 0; background: none; color: #15172e; font-size: 24px; line-height: 1; cursor: pointer; }
.prof-modal-hint { margin: 8px 0 14px; color: rgba(21, 23, 46, .55); font-size: 13px; }
.prof-modal-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-tag { border: 1px solid rgba(21, 23, 46, .12); border-radius: 100px; background: #fff; color: #15172e; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; cursor: pointer; }
.prof-tag.is-on { border-color: transparent; background: #3547b0; color: #fff; }
.prof-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.prof-modal-cancel { border: 1px solid rgba(21, 23, 46, .15); border-radius: 12px; background: #fff; color: #15172e; font: inherit; font-weight: 700; padding: 12px 18px; cursor: pointer; }
html[data-theme="dark"] .prof-tag-open,
html[data-theme="dark"] .prof-modal-card { background: #1e2142; }
html[data-theme="dark"] .prof-modal-head h2,
html[data-theme="dark"] .prof-tag-open,
html[data-theme="dark"] .prof-modal-close { color: #fff; }
html[data-theme="dark"] .prof-tag { background: transparent; color: #fff; border-color: rgba(251, 247, 241, .2); }
html[data-theme="dark"] .prof-id h2,
html[data-theme="dark"] .prof-fields b { color: #fff; }
html[data-theme="dark"] .prof-id p,
html[data-theme="dark"] .prof-fields b.is-empty { color: rgba(251, 247, 241, .7); }
html[data-theme="dark"] .prof-city,
html[data-theme="dark"] .prof-label,
html[data-theme="dark"] .prof-fields > div span,
html[data-theme="dark"] .prof-fields label { color: rgba(251, 247, 241, .5); }
html[data-theme="dark"] .prof-fields input,
html[data-theme="dark"] .prof-fields textarea { background: rgba(251, 247, 241, .06); border-color: rgba(251, 247, 241, .12); color: #fff; }
html[data-theme="dark"] .prof-edit-btn { color: #ff8562; }
html[data-theme="dark"] .prof-camera { background: #1e2142; }

.pass-back { display: inline-flex; margin-bottom: 12px; color: rgba(21, 23, 46, .55); font-size: 13px; font-weight: 700; text-decoration: none; }
.pass-hero { padding: clamp(18px, 2.4vw, 28px); border-radius: 22px; background: linear-gradient(140deg, #15172e 18%, #3a2318 110%); color: rgba(251, 247, 241, .75); }
.pass-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pass-hero-top span { color: rgba(251, 247, 241, .55); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pass-hero-top b { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 100px; background: rgba(251, 247, 241, .1); color: #fff; font-size: 12px; }
.pass-hero h1 { margin: 10px 0 0; color: #fff; font-size: clamp(22px, 1vw + 16px, 30px); line-height: 1.2; }
.pass-hero > p { margin: 10px 0 0; max-width: 62em; font-size: clamp(13px, 0.2vw + 12px, 15px); line-height: 1.5; }
.pass-hero .case-tags { margin-top: 14px; }
.pass-hero .case-tags span { background: rgba(251, 247, 241, .1); color: #fff; }
.pass-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.pass-stats div { padding: 12px; border-radius: 12px; background: rgba(251, 247, 241, .06); }
.pass-stats span { display: block; color: rgba(251, 247, 241, .5); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pass-stats b { display: block; margin-top: 4px; color: #fff; font-size: clamp(14px, 0.3vw + 12px, 16px); }
.pass-hero .cases-pillars { margin-top: 14px; }
.pass-hero .cases-pillars a { display: inline-block; margin-top: 8px; color: #8eb4ff; font-size: 12px; font-weight: 700; text-decoration: none; }
.pass-block { margin-top: 20px; }
.pass-block h2 { margin: 4px 0 12px; color: #15172e; font-size: clamp(18px, 0.5vw + 15px, 22px); }
.pass-block .desk-card { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.pass-block .desk-card p,
.pass-block .desk-card h3,
.pass-block .desk-card ul { margin: 0; }
.pass-block .desk-card p { color: rgba(21, 23, 46, .75); font-size: clamp(14px, 0.2vw + 13px, 15px); line-height: 1.5; }
.pass-block h3 { font-size: clamp(15px, 0.2vw + 14px, 16px); }
.pass-block ul { padding-left: 18px; }
.pass-block li { margin: 4px 0; font-size: clamp(14px, 0.2vw + 13px, 15px); }
.pass-note { background: #fbf6ea; }
.pass-block .prof-save { display: inline-flex; margin-top: 8px; text-decoration: none; }
html[data-theme="dark"] .pass-back,
html[data-theme="dark"] .pass-block h2,
html[data-theme="dark"] .pass-block h3 { color: #fff; }
html[data-theme="dark"] .pass-block .desk-card p,
html[data-theme="dark"] .pass-block li { color: rgba(251, 247, 241, .75); }
html[data-theme="dark"] .pass-note { background: #1e2142; }

.cases-hero {
  margin-top: 20px; padding: clamp(20px, 3vw, 36px); border-radius: clamp(16px, 1.5vw, 22px);
  background: linear-gradient(140deg, #15172e 20%, #3a2318 100%); color: rgba(251, 247, 241, .72);
}
.cases-hero > span { display: inline-flex; min-height: 27px; align-items: center; padding: 0 12px; border-radius: 100px; background: rgba(242, 84, 45, .1); color: #ff8562; font-size: clamp(11px, 0.15vw + 10.5px, 12px); font-weight: 700; }
.cases-hero h2 { margin: 12px 0 0; max-width: 18em; color: #fff; font-size: clamp(20px, 1vw + 14px, 26px); line-height: 1.25; }
.cases-hero > p { margin: 12px 0 0; max-width: 62em; font-size: clamp(13px, 0.2vw + 12px, 14px); line-height: 1.55; }
.cases-pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.cases-pillars article { padding: 16px; border: 1px solid rgba(251, 247, 241, .16); border-radius: 14px; background: rgba(21, 23, 46, .35); }
.cases-pillars b { display: block; color: #8eb4ff; font-size: clamp(13px, 0.2vw + 12px, 14px); }
.cases-pillars .is-accent { border-color: #f2542d; background: linear-gradient(160deg, #3a2318, #1e2142); }
.cases-pillars .is-accent b { color: #ff8562; }
.cases-pillars strong { display: block; margin-top: 8px; color: #fff; font-size: clamp(13px, 0.2vw + 12px, 14px); }
.cases-pillars p { margin: 6px 0 0; font-size: clamp(12px, 0.15vw + 11.5px, 13px); line-height: 1.45; }
.cases-pillars em { display: inline-flex; margin-top: 10px; padding: 3px 8px; border-radius: 100px; background: rgba(242, 84, 45, .18); color: #ff8562; font-size: 11px; font-style: normal; font-weight: 700; }
.cases-notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.cases-notes .desk-card { padding: 16px; }
.cases-notes h3 { margin: 0; color: #15172e; font-size: clamp(14px, 0.2vw + 13px, 15px); }
.cases-notes p { margin: 8px 0 0; color: rgba(21, 23, 46, .7); font-size: clamp(13px, 0.15vw + 12px, 14px); line-height: 1.45; }
.cases-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 16px; }
.cases-list-head h2 { margin: 0; color: #15172e; font-size: clamp(18px, 0.4vw + 16px, 22px); }
.cases-search { display: flex; gap: 8px; }
.cases-search input, .cases-search select, .cases-search button {
  height: 36px; border-radius: 10px; border: 1px solid rgba(21, 23, 46, .12); background: #fff; color: #15172e; font: inherit; font-size: 14px;
}
.cases-search input, .cases-search select { padding: 0 10px; }
.cases-search button { padding: 0 12px; font-weight: 700; cursor: pointer; }
.cases-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.case-tile { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border: 1px solid rgba(21, 23, 46, .07); border-radius: 16px; }
.case-tile.is-ready { border-color: #f2542d; }
.case-tile-top, .case-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-tile time { color: rgba(21, 23, 46, .5); font-size: clamp(12px, 0.15vw + 11px, 13px); }
.case-tile-top span { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 100px; background: rgba(21, 23, 46, .06); color: rgba(21, 23, 46, .7); font-size: 12px; font-weight: 700; }
.case-tile.is-ready .case-tile-top span { background: #15172e; color: #fff; }
.case-tile h3 { margin: 0; font-size: clamp(15px, 0.3vw + 13px, 17px); line-height: 1.35; }
.case-tile h3 a { color: #15172e; text-decoration: none; }
.case-tile > p { margin: 0; color: rgba(21, 23, 46, .7); font-size: clamp(13px, 0.15vw + 12px, 14px); line-height: 1.45; }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.case-tags span { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 100px; background: rgba(21, 23, 46, .06); color: rgba(21, 23, 46, .7); font-size: 12px; font-weight: 700; }
.case-tags span:last-child { background: rgba(201, 150, 47, .14); }
.case-tile-foot { margin-top: auto; padding-top: 8px; }
.case-tile-foot span { display: block; color: rgba(21, 23, 46, .45); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.case-tile-foot b { display: block; margin-top: 2px; color: #15172e; font-size: clamp(13px, 0.15vw + 12px, 14px); }
.cases-tabs { display: flex; gap: 8px; margin-top: 8px; }
.cases-tabs a { color: rgba(21, 23, 46, .55); font-size: 13px; font-weight: 700; text-decoration: none; }
.cases-tabs a.is-on { color: #15172e; }
.case-tile-foot form { margin: 0; }
.case-tile-foot a,
.case-tile-foot button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid rgba(21, 23, 46, .18); border-radius: 10px; background: transparent; color: #15172e; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer; }
.case-tile-foot button[disabled] { opacity: .55; cursor: default; }
.case-tile.is-ready .case-tile-foot a { background: #f2542d; border-color: #f2542d; color: #fff; }
html[data-theme="dark"] .cases-notes h3,
html[data-theme="dark"] .cases-list-head h2,
html[data-theme="dark"] .case-tile h3 a,
html[data-theme="dark"] .case-tile-foot b { color: #fff; }
html[data-theme="dark"] .cases-notes p,
html[data-theme="dark"] .case-tile > p { color: rgba(251, 247, 241, .7); }
html[data-theme="dark"] .case-tile,
html[data-theme="dark"] .cases-search input,
html[data-theme="dark"] .cases-search select,
html[data-theme="dark"] .cases-search button { background: #1e2142; border-color: rgba(251, 247, 241, .1); color: #fff; }
html[data-theme="dark"] .case-tile-top span,
html[data-theme="dark"] .case-tags span { background: rgba(251, 247, 241, .08); color: rgba(251, 247, 241, .7); }
html[data-theme="dark"] .case-tile.is-ready .case-tile-top span { background: #f2542d; color: #fff; }

@media (max-width: 1100px) {
  .desk-stats { grid-template-columns: 1fr 1fr; }
  .desk-grid, .prof, .cases-pillars, .cases-notes, .pass-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .cases-pillars, .cases-notes, .cases-grid, .pass-stats, .anketa-facts, .anketa-scale { grid-template-columns: 1fr; }
  .anketa-head-top { flex-direction: column; }
  .track-table .score-grid, .track-table .crit-extra { grid-template-columns: 1fr; }
  .cases-list-head, .cases-search { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .prof-fields { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .desk-burger { display: inline-flex; }
  .desk-side { transform: translateX(-105%); transition: transform .2s ease; }
  .desk-side.open { transform: none; }
  .desk-main { margin-left: 0; padding: 64px 16px 32px; }
}
@media (max-width: 560px) {
  .desk-stats { grid-template-columns: 1fr; }
  .desk-row { flex-direction: column; gap: 6px; }
}

.bc-filters { margin-bottom: 8px; padding: 10px 12px; }
.bc-filters .field { flex: 1 1 150px; min-width: 0; }
.bc-compose > label { margin-top: 12px; }
.bc-compose > label .muted { font-weight: 400; }
.bc-note { margin: 0 0 8px; }
.bc-layout { display: flex; flex-direction: column; gap: 8px; }
.bc-layout > .card + .card { margin-top: 0; }
.bc-people { padding: 0; overflow: hidden; }
.bc-people-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
.bc-people-head h2 { margin: 0; font-size: 18px; }
.bc-people-head input { width: min(340px, 55%); height: 36px; padding: 0 12px; font-size: 13px; }
.bc-scroll { max-height: 360px; overflow: auto; }
.bc-scroll th, .bc-scroll td { padding: 7px 10px; }
.bc-scroll tbody tr { cursor: pointer; }
.bc-scroll tbody tr:has(.bc-user:checked) { background: var(--accent-lo); }
.bc-scroll thead th { position: sticky; top: 0; z-index: 1; }
.bc-compose .grid-2-tight { gap: 8px; margin-top: 8px; }
.bc-compose .grid-2-tight .field { margin: 0; }
.bc-compose .field input { height: 36px; padding: 0 12px; font-size: 13px; }
.bc-channels { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bc-letter { margin-top: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.bc-letter p { margin: 0 0 8px; }
.bc-brand { margin-bottom: 10px; color: var(--accent); font-weight: 700; letter-spacing: .04em; }
.bc-subject-line { font-weight: 700; color: var(--ink); }
.bc-read-card { width: min(560px, 100%); }
.bc-read-body { margin-top: 12px; white-space: pre-wrap; line-height: 1.55; max-height: 50vh; overflow: auto; }
.bc-editor-shell { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.bc-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bc-editor-toolbar button { min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
.bc-editor-toolbar button:hover { border-color: var(--line); background: var(--surface); }
.bc-toolbar-gap { width: 1px; height: 22px; margin: 0 3px; background: var(--line); }
.bc-editor { min-height: 180px; max-height: 320px; overflow: auto; padding: 12px 14px; outline: none; line-height: 1.55; }
.bc-editor.is-empty:before { content: attr(data-placeholder); color: var(--ink-3); }
.bc-editor p { margin: 0 0 10px; }
.bc-editor h2, .bc-editor h3 { margin: 12px 0 8px; }
.bc-editor ul, .bc-editor ol { margin: 0 0 10px; padding-left: 22px; }
.bc-editor blockquote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.bc-editor a { color: var(--accent); }
#bc-preview-body p { margin: 0 0 8px; }
#bc-preview-body h2, #bc-preview-body h3 { margin: 12px 0 8px; color: var(--ink); }
#bc-preview-body ul, #bc-preview-body ol { margin: 0 0 8px; padding-left: 22px; }
#bc-preview-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); }
