/* EasyBoard — светлая тема в стиле KEY POINT GROUP */

/* Шрифты хранятся локально (SIL OFL 1.1, лицензии в ../fonts). Файлы вариативные. */
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/geologica-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Geologica";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/geologica-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/golos-text-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Фирменная палитра */
  --midnight: #001B34;      /* Midnight Core: текст, тёмные плашки */
  --navy: #004B96;          /* Steel Navy (RGB 0 75 150) */
  --navy-hover: #003C78;
  --navy-soft: #E8F0F8;
  --cyan: #0ABEF0;          /* Pulse Cyan: только акценты */
  --cyan-soft: #E4F7FD;
  --silver: #9C9D9D;        /* Urban Silver: только декор */

  /* Интерфейс */
  --bg: #F5F8FA;
  --surface: #FFFFFF;
  --surface-2: #F0F4F7;
  --border: #DCE4EA;
  --border-strong: #C5D2DC;
  --text: #001B34;
  --text-2: #667784;

  /* Семантика */
  --success: #15803D;
  --success-soft: #EAF6EE;
  --warning: #B45309;
  --warning-soft: #FDF3E7;
  --danger: #C62828;
  --danger-soft: #FCECEC;

  --radius-card: 14px;
  --radius-field: 10px;
  --shadow-card: 0 1px 2px rgba(0, 27, 52, .04), 0 2px 6px rgba(0, 27, 52, .03);
  --shadow-pop: 0 16px 40px rgba(0, 27, 52, .16);

  --font-heading: "Geologica", "Segoe UI", sans-serif;
  --font-sans: "Golos Text", "Segoe UI", sans-serif;
  --sidebar-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
/* Атрибут hidden скрывает элемент всегда: display компонентов (.alert, .badge, .btn…) его не перебивает. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-heading); font-weight: 600; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.icon { flex-shrink: 0; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.sidebar__brand { padding: 20px 16px 8px; }
.brand {
  display: block; border-radius: 12px; background: var(--midnight); color: #fff;
  padding: 14px 16px;
}
.brand__name { font: 700 17px/1 var(--font-heading); letter-spacing: .06em; }
.brand__group { margin-top: 5px; font: 600 10px/1 var(--font-heading); letter-spacing: .42em; color: var(--cyan); }
.brand__product { margin-top: 10px; font-size: 12px; color: rgba(255, 255, 255, .7); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group { margin-top: 18px; }
.nav-group__title {
  padding: 0 12px 6px;
  font: 600 11px/1.2 var(--font-heading); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2);
}
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 8px 12px; border-radius: 8px;
  font: 500 14px/1.3 var(--font-heading); color: rgba(0, 27, 52, .82);
  transition: background-color .15s, color .15s;
}
.nav-link .icon { color: var(--text-2); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link:hover .icon { color: var(--text); }
.nav-link.is-active { background: var(--navy-soft); color: var(--navy); }
.nav-link.is-active .icon { color: var(--navy); }
.nav-link.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--cyan);
}
.nav-link__meta {
  margin-left: auto; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2); font: 600 11px/1.4 var(--font-heading);
}
.nav-link.is-active .nav-link__meta { background: var(--surface); color: var(--navy); }
.nav-link__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid var(--border);
}
.sidebar__user-name { min-width: 0; flex: 1; font: 500 14px/1.3 var(--font-heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-name small { display: block; font: 400 12px/1.3 var(--font-sans); color: var(--text-2); }

.topbar { display: none; }
.main { min-height: 100vh; padding-left: var(--sidebar-w); }
.container { max-width: 1440px; margin: 0 auto; padding: 32px; }

.drawer-backdrop { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease, visibility .2s; width: 280px; max-width: 85vw; z-index: 50; visibility: hidden; }
  .drawer-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  .drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 27, 52, .4); }
  .drawer-open { overflow: hidden; }
  .topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 16px;
    background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--border);
  }
  .topbar__brand { font: 700 14px/1 var(--font-heading); letter-spacing: .06em; color: var(--midnight); }
  .topbar__brand span { margin-left: 6px; font-size: 10px; letter-spacing: .3em; color: var(--navy); }
  .main { padding-left: 0; }
  .container { padding: 20px 16px 32px; }
}
/* Селектор с .sidebar, чтобы перебить display у .btn, объявленного ниже. */
.sidebar .sidebar__close { display: none; position: absolute; top: 8px; right: 8px; }
@media (max-width: 1023px) {
  .sidebar .sidebar__close { display: flex; }
  .sidebar__brand { padding-top: 56px; }
}

/* ---------- Typography blocks ---------- */
.page { display: flex; flex-direction: column; gap: 24px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-header__title { font-size: 28px; }
.page-header__subtitle { margin-top: 6px; color: var(--text-2); }
.page-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.breadcrumbs a:hover { color: var(--navy); text-decoration: underline; }
@media (max-width: 640px) { .page-header__title { font-size: 24px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-field);
  font: 500 14px/1 var(--font-heading); white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-hover); }
.btn--secondary { background: var(--surface); color: var(--navy); border-color: rgba(0, 75, 150, .6); }
.btn--secondary:hover { background: var(--navy-soft); border-color: var(--navy); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--light { background: #fff; color: var(--midnight); }
.btn--light:hover { background: rgba(255, 255, 255, .9); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .1); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--icon { width: 40px; padding: 0; background: transparent; color: var(--text-2); }
.btn--icon:hover { background: var(--surface-2); color: var(--text); }
.btn--block { width: 100%; }

.link { font: 500 14px/1.4 var(--font-heading); color: var(--navy); display: inline-flex; align-items: center; gap: 4px; }
.link:hover { color: var(--navy-hover); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.card--clip { overflow: hidden; }
.card__body { padding: 24px; }
.card__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; }
.card__header--divided { border-bottom: 1px solid var(--border); }
.card__title { font-size: 18px; }
.card__subtitle { margin-top: 2px; font-size: 14px; color: var(--text-2); }
@media (max-width: 640px) { .card__body { padding: 20px; } .card__header { padding: 18px 20px; } }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-card);
  background-color: var(--midnight); color: #fff; padding: 36px 40px;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 14px 14px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px;
}
.hero__date { font-size: 14px; color: rgba(255, 255, 255, .7); }
.hero__date::first-letter { text-transform: uppercase; }
.hero__title { margin-top: 6px; font-size: 34px; }
.hero__text { margin-top: 10px; max-width: 640px; color: rgba(255, 255, 255, .82); }
.hero__actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 640px) { .hero { padding: 24px 20px; } .hero__title { font-size: 26px; } }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1279px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; padding: 24px; }
.stat__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.stat__label { font-size: 15px; color: var(--text-2); }
.stat__value { margin-top: 8px; font: 600 36px/1.1 var(--font-heading); }
.stat__link { margin-top: 16px; align-self: flex-start; }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1023px) { .stats--3 { grid-template-columns: 1fr; } }
.stat--link { color: inherit; transition: border-color .15s, background-color .15s; }
.stat--link:hover { border-color: var(--navy); }
.stat--link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.stat--link.is-active { border-color: var(--navy); background: var(--navy-soft); }
@media (max-width: 1023px) {
  .stats--3 .stat { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 16px 20px; }
  .stats--3 .stat__head { flex: 1 1 auto; align-items: center; }
  .stats--3 .stat__value { margin-top: 0; font-size: 28px; }
  .stats--3 .stat__link { margin-top: 0; flex-basis: 100%; }
}

/* Главная: раздел «Мои обращения» */
.my-requests__header { border-bottom: 0; padding-bottom: 8px; }
.my-requests__body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; }
.registry-filters.my-requests__filters { padding: 0; }
.my-requests__total { padding: 0 24px 12px; font-size: 14px; }
.my-requests .stat { box-shadow: none; }
.my-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border); overflow-x: auto; }
@media (max-width: 640px) {
  .my-requests__body { padding: 16px 20px; }
  .my-requests__total { padding: 0 20px 12px; }
  .my-tabs { padding: 0 12px; }
}
.my-tabs__link {
  margin-bottom: -1px; padding: 10px 16px; border-bottom: 2px solid transparent; white-space: nowrap;
  font: 500 15px/1.3 var(--font-heading); color: var(--text-2);
}
.my-tabs__link:hover { color: var(--navy); }
.my-tabs__link.is-active { border-bottom-color: var(--navy); color: var(--navy); }
.icon-tile {
  width: 42px; height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--navy-soft); color: var(--navy);
}
.icon-tile--warning { background: var(--warning-soft); color: var(--warning); }
.icon-tile--danger { background: var(--danger-soft); color: var(--danger); }
.icon-tile--success { background: var(--success-soft); color: var(--success); }
.icon-tile--lg { width: 48px; height: 48px; border-radius: 12px; }

/* Grids */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.grid-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.grid-detail > * { min-width: 0; }
@media (max-width: 1023px) { .grid-detail { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .grid-cards { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Tables ---------- */
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  padding: 12px 16px; background: var(--surface-2); text-align: left; white-space: nowrap;
  font: 600 13px/1.3 var(--font-heading); color: var(--text);
}
.table td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: var(--bg); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table__primary { font: 500 14px/1.35 var(--font-heading); color: var(--text); }
.table__primary:hover { color: var(--navy); text-decoration: underline; }
.table__secondary { display: block; margin-top: 2px; font-size: 12px; color: var(--text-2); }
.table__line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.table .right { text-align: right; }

/* На узких экранах строки таблицы превращаются в карточки: подпись колонки берётся из data-label. */
@media (max-width: 640px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 14px 20px; border-top: 1px solid var(--border); }
  .table--stack tbody tr:hover { background: transparent; }
  .table--stack td,
  .table--stack td:first-child,
  .table--stack td:last-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0 !important; padding: 4px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); flex-shrink: 0; font-size: 13px; color: var(--text-2); text-align: left; }
  .table--stack td.table__cell-main { display: block; padding-bottom: 8px; text-align: left; }
  .table--stack td.table__cell-main::before,
  .table--stack td:not([data-label])::before { content: none; }
  .table--stack td:not([data-label]) { justify-content: flex-end; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid transparent;
  border-radius: 999px; font: 500 12px/1.4 var(--font-heading); white-space: nowrap;
}
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge--info { background: var(--navy-soft); color: var(--navy); border-color: rgba(0, 75, 150, .2); }
.badge--accent { background: var(--cyan-soft); color: var(--navy); border-color: rgba(10, 190, 240, .4); }
.badge--navy { background: var(--navy); color: #fff; }
.badge--success { background: var(--success-soft); color: var(--success); border-color: rgba(21, 128, 61, .25); }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(180, 83, 9, .25); }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(198, 40, 40, .25); }
.code {
  display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2);
  font: 600 12px/1.5 var(--font-heading); letter-spacing: .02em; color: var(--text);
}

/* ---------- Avatar ---------- */
.avatar {
  width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--navy-soft); color: var(--navy); font: 600 12px/1 var(--font-heading);
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid > * { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font: 500 14px/1.3 var(--font-sans); color: var(--text); }
.field__required { color: var(--danger); margin-left: 2px; }
.field__help { font-size: 12px; color: var(--text-2); }
.field__error { display: flex; gap: 6px; font-size: 13px; font-weight: 500; color: var(--danger); }
.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field textarea,
.input {
  width: 100%; height: 44px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field);
  font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: 120px; min-height: 88px; padding: 10px 12px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover, .input:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(10, 190, 240, .25);
}
.field input:disabled, .field select:disabled, .field textarea:disabled {
  background: var(--surface-2); color: var(--text-2); border-style: dashed; cursor: not-allowed;
}
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.form-actions--split { justify-content: space-between; }
@media (max-width: 640px) { .form-actions .btn { flex: 1; } }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid; border-radius: 12px; font-size: 14px; }
.alert__title { font: 600 14px/1.4 var(--font-heading); }
.alert--danger { background: var(--danger-soft); border-color: rgba(198, 40, 40, .3); color: var(--text); }
.alert--danger .icon { color: var(--danger); }
.alert--info { background: var(--navy-soft); border-color: rgba(0, 75, 150, .2); }
.alert--info .icon { color: var(--navy); }
.alert--success { background: var(--success-soft); border-color: rgba(21, 128, 61, .3); }
.alert--success .icon { color: var(--success); }

/* ---------- Empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; }
.empty__title { margin-top: 16px; font: 600 16px/1.35 var(--font-heading); }
.empty__text { margin-top: 4px; max-width: 380px; font-size: 14px; color: var(--text-2); }
.empty__action { margin-top: 20px; }
.empty--compact { padding: 28px 16px; }

/* ---------- Workspace / board cards ---------- */
.tile { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; transition: border-color .15s, box-shadow .15s; }
a.tile:hover { border-color: rgba(0, 75, 150, .4); box-shadow: 0 4px 14px rgba(0, 27, 52, .06); }
.tile__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tile__title { font: 600 17px/1.3 var(--font-heading); word-break: break-word; }
.tile__facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: var(--text-2); }
.tile__facts strong { color: var(--text); font: 600 14px/1 var(--font-heading); margin-right: 4px; }
.tile__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; padding: 18px 20px; border-radius: 12px; background: var(--bg); }
.fact__label { font-size: 12px; color: var(--text-2); }
.fact__value { margin-top: 3px; font: 500 15px/1.35 var(--font-heading); }

/* ---------- Kanban ---------- */
.kanban { position: relative; display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kanban__col {
  flex: 1 0 260px; max-width: 360px; display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-card);
}
.kanban__head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; }
.kanban__title { font: 600 14px/1.3 var(--font-heading); }
.kanban__count { margin-left: auto; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--surface); text-align: center; font: 600 12px/1.6 var(--font-heading); color: var(--text-2); }
.kanban__list { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; }
.kanban__empty { padding: 20px 8px; border: 1px dashed var(--border-strong); border-radius: 10px; text-align: center; font-size: 13px; color: var(--text-2); }
.ticket {
  display: block; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); transition: border-color .15s, box-shadow .15s;
}
.ticket:hover { border-color: rgba(0, 75, 150, .4); box-shadow: 0 4px 14px rgba(0, 27, 52, .08); }
.ticket__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket__number { font: 600 12px/1.4 var(--font-heading); color: var(--text-2); letter-spacing: .02em; }
.ticket__title { margin-top: 8px; font: 500 14px/1.4 var(--font-heading); color: var(--text); word-break: break-word; }
.ticket__meta { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.ticket__due { display: inline-flex; align-items: center; gap: 4px; }
.ticket__due--overdue { color: var(--danger); font-weight: 600; }

/* ---------- Detail ---------- */
.props { display: flex; flex-direction: column; }
.prop { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.prop:first-child { border-top: 0; padding-top: 0; }
.prop__label { color: var(--text-2); }
.prop__value { text-align: right; font-weight: 500; min-width: 0; }
.description { white-space: pre-line; color: var(--text); }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.section-title .icon { color: var(--navy); }
.section-title .count { color: var(--text-2); font-weight: 500; }

.comments { display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; }
.comment__bubble { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 0 12px 12px 12px; background: var(--bg); border: 1px solid var(--border); }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.comment__author { font: 600 14px/1.3 var(--font-heading); }
.comment__time { font-size: 12px; color: var(--text-2); }
.comment__text { margin-top: 6px; font-size: 14px; word-break: break-word; overflow-wrap: anywhere; }
.comment__plain { white-space: pre-line; }
.file-picks[hidden] { display: none !important; }
.comments[hidden], .comment [hidden], .reply-context[hidden] { display: none !important; }
.comment { scroll-margin-top: 24px; }
.comment__actions { display: inline-flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
.comment__action { font: 500 13px/1.3 var(--font-heading); color: var(--navy); }
.comment__action:hover { color: var(--navy-hover); text-decoration: underline; text-underline-offset: 2px; }
.comment__bubble { transition: background-color .4s, border-color .4s, box-shadow .4s; }
.comment.is-highlighted .comment__bubble, .comment:target .comment__bubble { border-color: var(--navy); background: var(--navy-soft); box-shadow: 0 0 0 3px rgba(0, 75, 150, .12); }
.comment-quote {
  display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding: 6px 10px;
  border-left: 3px solid var(--navy); border-radius: 0 8px 8px 0; background: var(--surface); color: var(--text-2); font-size: 13px;
}
a.comment-quote:hover { background: var(--navy-soft); }
.comment-quote__head { font: 500 12px/1.4 var(--font-heading); color: var(--navy); }
.comment-quote__text, .reply-context__text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; word-break: break-word; color: var(--text);
}
.comment-quote--missing { border-left-color: var(--border-strong); font-style: italic; }
.reply-context { display: flex; align-items: flex-start; gap: 12px; padding: 8px 8px 8px 12px; border-left: 3px solid var(--navy); border-radius: 0 10px 10px 0; background: var(--navy-soft); }
.reply-context__body { flex: 1; min-width: 0; font-size: 13px; }
.reply-context__title { font: 500 12px/1.4 var(--font-heading); color: var(--navy); }
.comment__edited { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.comment__edit { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.comment__edit-text { width: 100%; min-height: 88px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); resize: vertical; }
.comment__edit-text:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.comment__edit-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.comment__edit-hint { margin-right: auto; font-size: 12px; color: var(--text-2); }
.comment__edit.is-busy { opacity: .7; cursor: progress; }
.comment__files { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.comment__file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; }
.comment__file a { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--navy); font-weight: 500; }
.comment__file a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment__file a:hover { color: var(--navy-hover); text-decoration: underline; text-underline-offset: 2px; }
.comment__file-size { flex-shrink: 0; font-size: 12px; color: var(--text-2); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 16px; }
.timeline__item { position: relative; padding-left: 22px; font-size: 14px; }
.timeline__item::before { content: ""; position: absolute; left: 0; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy); }
.timeline__item::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: -14px; width: 1px; background: var(--border); }
.timeline__item:last-child::after { display: none; }
.timeline__meta { font-size: 12px; color: var(--text-2); }
.timeline__change { margin-top: 2px; word-break: break-word; }
.timeline__field { font-weight: 600; font-family: var(--font-heading); }
.timeline__old { color: var(--text-2); text-decoration: line-through; }

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__brand {
  background-color: var(--midnight); color: #fff; padding: 48px;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 14px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth__lead { max-width: 440px; }
.auth__lead h1 { font-size: 36px; }
.auth__lead p { margin-top: 12px; color: rgba(255, 255, 255, .75); }
.auth__form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth__form { width: 100%; max-width: 400px; }
.auth__form h2 { font-size: 26px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: 24px 20px; gap: 24px; }
  .auth__lead h1 { font-size: 26px; }
}
.prop__value--danger { color: var(--danger); }

/* ---------- Сообщения и правка параметров заявки ---------- */
.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.props__hint { margin: -8px 0 12px; font-size: 13px; }
.prop--edit { flex-direction: column; align-items: stretch; gap: 6px; }
.prop--edit .prop__value { margin: 0; text-align: left; }
.prop-form { display: flex; gap: 8px; align-items: center; }
.prop-form select,
.prop-form input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.prop-form select:hover, .prop-form input:hover { border-color: var(--border-strong); }
.prop-form select:focus, .prop-form input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(10, 190, 240, .25); }
.prop-form--danger input { border-color: var(--danger); color: var(--danger); }
.prop-form .btn { flex-shrink: 0; }

/* ---------- Реестр обращений ---------- */
.registry-filters { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.registry-filters__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.registry-filters__search { grid-column: span 3; }
.registry-filters .field__label { font-size: 13px; color: var(--text-2); }
.registry-filters .field input,
.registry-filters .field select { height: 40px; font-size: 14px; }
.registry-filters__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 1279px) {
  .registry-filters__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .registry-filters__search { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .registry-filters { padding: 18px 20px; }
  .registry-filters__grid { grid-template-columns: 1fr; }
  .registry-filters__actions .btn { flex: 1; }
}

@media (min-width: 641px) {
  .table--compact th, .table--compact td { padding: 10px 12px; }
  .table--compact th:first-child, .table--compact td:first-child { padding-left: 20px; }
  .table--compact th:last-child, .table--compact td:last-child { padding-right: 20px; }
}
.registry-table__number { font: 600 13px/1.35 var(--font-heading); color: var(--navy); letter-spacing: .02em; }
.registry-table__number:hover { text-decoration: underline; text-underline-offset: 2px; }
.registry-table__title { min-width: 200px; max-width: 360px; word-break: break-word; }
.registry-table tr.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
.registry-table tr.is-overdue:hover { background: var(--danger-soft); }

.sort-link { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sort-link:hover { color: var(--navy); }
.sort-link__arrow { font-size: 12px; color: var(--silver); }
.sort-link.is-active .sort-link__arrow { color: var(--navy); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.pagination__info { font-size: 13px; color: var(--text-2); }
.pagination__list { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pagination__link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font: 500 13px/1 var(--font-heading); color: var(--text); transition: background-color .15s, border-color .15s;
}
a.pagination__link:hover { border-color: var(--navy); color: var(--navy); }
.pagination__link.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination__link.is-disabled { color: var(--border-strong); }
.pagination__gap { padding: 0 4px; color: var(--text-2); }

@media (max-width: 640px) {
  .registry-table__title { min-width: 0; max-width: none; text-align: right; }
  .registry-table td.table__cell-main { padding-bottom: 6px; }
  .pagination { justify-content: center; }
}

/* ---------- Интерактивный канбан ---------- */
/* Атрибут hidden должен побеждать display у компонентов (.badge, .btn и т. п.). */
.kanban [hidden], .kanban__add [hidden] { display: none !important; }
.board-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px 20px; }
.board-filters .field { flex: 1 1 200px; max-width: 280px; }
.board-filters .field__label { font-size: 13px; color: var(--text-2); }
.board-filters .field select { height: 40px; font-size: 14px; }
.board-filters__actions { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 640px) {
  .board-filters .field { max-width: none; flex-basis: 100%; }
  .board-filters__actions { width: 100%; }
  .board-filters__actions .btn { flex: 1; }
}

.kanban__col { transition: border-color .15s, background-color .15s, box-shadow .15s; }
.kanban__col--final .kanban__head { color: var(--success); }
.kanban__col--final .kanban__title { color: var(--text); }
.kanban__col.is-drop-target { border: 1px dashed var(--cyan); background: var(--cyan-soft); box-shadow: 0 0 0 3px rgba(10, 190, 240, .2); }
.kanban.is-dragging .kanban__empty { border-color: var(--cyan); color: var(--navy); }
.kanban__list { min-height: 72px; }
.kanban__hint { font-size: 13px; margin-top: -12px; }

.ticket { position: relative; }
.ticket__number { position: relative; z-index: 1; color: var(--navy); }
.ticket__number:hover { text-decoration: underline; text-underline-offset: 2px; }
.ticket__link { color: inherit; }
.ticket__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ticket__link:focus-visible { outline: none; }
.ticket:has(.ticket__link:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ticket__meta { flex-wrap: wrap; }
.ticket .badge { padding: 2px 8px; font-size: 11px; }
.ticket--overdue { border-left: 3px solid var(--danger); }
.ticket--overdue .ticket__due { color: var(--danger); font-weight: 600; }
.kanban--movable .ticket { cursor: grab; }
.kanban--movable .ticket:active { cursor: grabbing; }
.ticket.is-dragging { opacity: .45; }
.ticket.is-saving { opacity: .6; pointer-events: none; }
.ticket.is-saving::before {
  content: ""; position: absolute; top: 10px; right: 10px; width: 14px; height: 14px; z-index: 2;
  border: 2px solid var(--border-strong); border-top-color: var(--navy); border-radius: 50%; animation: eb-spin .7s linear infinite;
}
@keyframes eb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ticket.is-saving::before { animation: none; } }

.ticket__move { position: relative; z-index: 1; display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ticket__move select {
  flex: 1; min-width: 0; height: 30px; padding: 0 8px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer;
}
.ticket__move select:hover { border-color: var(--border-strong); }
.ticket__move select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(10, 190, 240, .25); }
.ticket__move select:disabled { cursor: progress; }
.js .ticket__move-submit { display: none; }
/* На устройствах с точным указателем список этапов появляется при наведении или фокусе, чтобы карточки оставались компактными. */
@media (hover: hover) and (pointer: fine) {
  .js .ticket__move { display: none; }
  .js .ticket:hover .ticket__move,
  .js .ticket:focus-within .ticket__move { display: flex; }
}

.kanban__add { flex: 0 0 260px; }
.kanban__add-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-card); background: transparent;
  font: 500 14px/1 var(--font-heading); color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s;
}
.kanban__add-toggle:hover { border-color: var(--navy); color: var(--navy); background: var(--surface); }
.kanban__add-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.kanban__add-form[hidden] { display: none; }
.kanban__add-form .field input { height: 40px; font-size: 14px; }
.kanban__add-form .field input[aria-invalid="true"] { border-color: var(--danger); }
.kanban__add-actions { display: flex; justify-content: flex-end; gap: 8px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex-shrink: 0; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background-color .15s; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 27, 52, .2); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--cyan); outline-offset: 2px; }

.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  padding: 12px 16px; border-radius: 12px; background: var(--midnight); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-pop); transition: opacity .3s, transform .3s;
}
.toast--error { background: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
@media (max-width: 640px) { .toast-region { right: 16px; left: 16px; bottom: 16px; max-width: none; } }

/* ---------- Вложения заявки ---------- */
.attachment-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.attachment:first-child { border-top: 0; padding-top: 0; }
.attachment__icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--navy-soft); color: var(--navy); }
.attachment__body { flex: 1; min-width: 0; }
.attachment__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.4 var(--font-heading); color: var(--navy); }
.attachment__name:hover { color: var(--navy-hover); text-decoration: underline; text-underline-offset: 2px; }
.attachment__meta { margin-top: 2px; font-size: 12px; color: var(--text-2); }
.attachment__delete .btn:hover { color: var(--danger); }

.dropzone { display: flex; flex-direction: column; gap: 10px; }
.dropzone__area {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--bg); color: var(--text-2);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone__area .icon { color: var(--navy); }
.dropzone__area:hover, .dropzone.is-dragover .dropzone__area { border-color: var(--navy); background: var(--navy-soft); }
.dropzone__title { font: 500 14px/1.4 var(--font-heading); color: var(--text); }
.dropzone__pick { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.dropzone__hint { max-width: 520px; font-size: 12px; }
.dropzone__input { font-size: 14px; }
.dropzone__status { font-size: 13px; color: var(--text-2); }
.dropzone__status:empty { display: none; }
.dropzone.is-busy .dropzone__area { opacity: .6; cursor: progress; }
/* С JavaScript файлы собираются в список под зоной и уходят вместе с комментарием. */
.js .dropzone__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.js .dropzone:focus-within .dropzone__area { outline: 2px solid var(--cyan); outline-offset: 2px; }
.dropzone__title--js, .js .dropzone__title--nojs { display: none; }
.js .dropzone__title--js { display: inline; }
.dropzone__area--compact { padding: 14px 16px; }
.comment-form.is-busy .dropzone__area { opacity: .6; cursor: progress; }
.file-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.file-pick { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--navy-soft); font-size: 13px; }
.file-pick__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-pick__size { flex-shrink: 0; color: var(--text-2); }
.file-pick__remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); font-size: 16px; line-height: 1; cursor: pointer; }
.file-pick__remove:hover, .file-pick__remove:focus-visible { background: var(--surface); color: var(--danger); }
.attachments__hint { font-size: 13px; }
.attachment__comment { color: var(--navy); }

/* ---------- Ветки комментариев ---------- */
.comments > .thread { display: flex; flex-direction: column; gap: 10px; }
.thread__replies { display: flex; flex-direction: column; gap: 10px; margin-left: 44px; padding-left: 12px; border-left: 2px solid var(--border); }
.replies { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.replies:empty { display: none; }
.comment--reply .avatar { width: 28px; height: 28px; font-size: 11px; }
.comment--reply .comment__bubble { padding: 10px 12px; }
.thread__more > .replies { margin-top: 10px; }
.thread__toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font: 500 13px/1.3 var(--font-heading); color: var(--navy);
}
.thread__toggle::-webkit-details-marker { display: none; }
.thread__toggle::before { content: "▸"; transition: transform .15s; }
.thread__more[open] > .thread__toggle::before { transform: rotate(90deg); }
.thread__toggle:hover { text-decoration: underline; text-underline-offset: 2px; }
.thread__toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.thread__toggle-hide, .thread__more[open] > .thread__toggle .thread__toggle-show { display: none; }
.thread__more[open] > .thread__toggle .thread__toggle-hide { display: inline; }
@media (max-width: 640px) {
  .thread__replies { margin-left: 14px; padding-left: 10px; }
  .comment--reply .avatar { display: none; }
}

/* ---------- Упоминания ---------- */
.mention { padding: 0 3px; border-radius: 4px; background: var(--navy-soft); color: var(--navy); font-weight: 600; white-space: nowrap; }
.mention--me { background: var(--cyan-soft); color: var(--midnight); box-shadow: inset 0 0 0 1px var(--cyan); }
.mention-field, .comment__edit { position: relative; }
.mention-menu {
  position: absolute; z-index: 35; left: 0; right: 0; max-width: 360px; max-height: 260px; overflow-y: auto;
  margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop);
}
.mention-menu[hidden] { display: none; }
.mention-menu__item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mention-menu__item.is-active, .mention-menu__item:hover { background: var(--navy-soft); }
.mention-menu__name { font: 500 14px/1.3 var(--font-heading); }
.mention-menu__login { font-size: 12px; color: var(--text-2); }
.mention-menu__empty { padding: 8px 10px; font-size: 13px; color: var(--text-2); }

/* ---------- Уведомления ---------- */
.appbar { display: flex; justify-content: flex-end; max-width: 1440px; margin: 0 auto; padding: 12px 32px 0; }
.appbar + .container { padding-top: 8px; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }
@media (max-width: 1023px) { .appbar { display: none; } }
.notif { position: relative; }
.notif__bell { position: relative; }
.notif__count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font: 600 11px/18px var(--font-heading); text-align: center;
}
.notif__count[hidden], .notif__panel[hidden] { display: none; }
.notif__panel {
  position: absolute; z-index: 45; top: calc(100% + 8px); right: 0; width: min(380px, calc(100vw - 32px));
  display: flex; flex-direction: column; max-height: min(520px, calc(100vh - 96px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
}
.notif__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 16px; border-bottom: 1px solid var(--border); }
.notif__title { font: 600 15px/1.3 var(--font-heading); }
.notif__body { overflow-y: auto; }
.notif__empty { padding: 20px 16px; color: var(--text-2); font-size: 14px; }
.notif__all { padding: 10px 16px; border-top: 1px solid var(--border); font: 500 13px/1.3 var(--font-heading); color: var(--navy); text-align: center; }
.notif__all:hover { background: var(--surface-2); }
.notif-list { margin: 0; padding: 0; list-style: none; }
.notif-list > li + li { border-top: 1px solid var(--border); }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; color: var(--text); }
.notif-item:hover { background: var(--surface-2); }
.notif-item:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.notif-item.is-unread { background: var(--navy-soft); }
.notif-item__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.notif-item__title { font: 600 13px/1.3 var(--font-heading); color: var(--navy); }
.notif-item__text { font-size: 14px; word-break: break-word; }
.notif-item__quote { padding: 6px 8px; border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--text-2); word-break: break-word; }
.notif-item__quote--missing { font-style: italic; }
.notif-item__time { font-size: 12px; color: var(--text-2); }
.notif-item__dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--navy); }
.notif-page { overflow: hidden; }
@media (max-width: 640px) {
  .notif__panel { position: fixed; top: 64px; right: 16px; left: 16px; width: auto; }
}
.notif__more { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.notif-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.notif-tabs__link { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: 500 14px/1.3 var(--font-heading); color: var(--text-2); }
.notif-tabs__link:hover { border-color: var(--navy); color: var(--navy); }
.notif-tabs__link.is-active { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }

/* ---------- Управление доступом ---------- */
.access-choices { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.access-choice { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.access-choice input { margin-top: 3px; flex-shrink: 0; }
.access-choice > span { display: flex; flex-direction: column; gap: 2px; }
.access-choice .muted { font-size: 13px; }
.details-edit > summary { cursor: pointer; font-size: 14px; }

/* ---------- Отображение Markdown (описания, комментарии, предпросмотр) ---------- */
.md { font-size: 15px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.comment__text.md { font-size: 14px; line-height: 1.55; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md .md-table, .md .md-code, .md hr { margin: 0 0 .75em; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.1em 0 .5em; line-height: 1.3; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.3em; } .md h3 { font-size: 1.15em; }
.md h4, .md h5, .md h6 { font-size: 1em; }
.md ul, .md ol { padding-left: 1.5em; }
.md ul { list-style: disc; } .md ol { list-style: decimal; } .md ul ul { list-style: circle; }
.md li + li { margin-top: .2em; }
.md li > ul, .md li > ol { margin: .2em 0 0; }
.md .contains-task-list { padding-left: .25em; list-style: none; }
.md .task-list-item-checkbox { margin: 0 .45em 0 0; vertical-align: -1px; accent-color: var(--navy); }
.md blockquote { padding: 4px 0 4px 14px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); }
.md a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.md strong { font-weight: 600; }
.md :not(pre) > code {
  padding: .1em .35em; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border);
  font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere;
}
.md .md-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.md table { border-collapse: collapse; font-size: .95em; }
.md th, .md td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.md .md-image { display: inline-block; max-width: 100%; margin: 4px 0; border: 1px solid var(--border); border-radius: 9px; line-height: 0; cursor: zoom-in; }
.md .md-image:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.md .md-image--pending { max-height: 320px; border: 1px dashed var(--border-strong); }
.md .md-file::before { content: "📎 "; }
.md .md-missing { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: .9em; }
.md .mention { white-space: nowrap; }

.md-code { position: relative; border: 1px solid var(--border); border-radius: 10px; background: #F7F9FB; overflow: hidden; }
.md-code__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.md-code__lang { font: 500 12px/1.3 var(--font-heading); color: var(--text-2); text-transform: none; }
.md-code__copy { height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font: 500 12px/1 var(--font-heading); color: var(--navy); cursor: pointer; }
.md-code__copy:hover, .md-code__copy:focus-visible { border-color: var(--navy); }
.md-code__copy.is-done { color: var(--success); border-color: var(--success); }
.md-code__pre { margin: 0; padding: 12px 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 640px; }
.md-code__body { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; white-space: pre; tab-size: 4; color: #1F2933; }
/* Подсветка синтаксиса (классы Pygments с префиксом hl-) */
.md-code__body [class^="hl-k"], .md-code__body .hl-ow { color: #8A3FA0; font-weight: 500; }
.md-code__body [class^="hl-s"] { color: #1E7A3C; }
.md-code__body [class^="hl-m"] { color: #B4510F; }
.md-code__body [class^="hl-c"] { color: #6B7B88; font-style: italic; }
.md-code__body .hl-nf, .md-code__body .hl-fm, .md-code__body .hl-nc { color: #0057B0; }
.md-code__body .hl-nb, .md-code__body .hl-bp, .md-code__body .hl-nd { color: #00708A; }
.md-code__body .hl-nt { color: #0057B0; }
.md-code__body .hl-na, .md-code__body .hl-nv, .md-code__body .hl-vg, .md-code__body .hl-vi { color: #A8410F; }
.md-code__body .hl-o { color: #4A5965; }
.md-code__body .hl-gi { color: #1E7A3C; background: #EAF6EE; }
.md-code__body .hl-gd { color: #C62828; background: #FCECEC; }
.md-code__body .hl-gh, .md-code__body .hl-gu { color: #0057B0; font-weight: 600; }

.md-lightbox { max-width: min(96vw, 1400px); max-height: 94vh; padding: 12px; border: 0; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-pop); }
.md-lightbox::backdrop { background: rgba(0, 27, 52, .72); }
.md-lightbox__img { display: block; max-width: 100%; max-height: calc(94vh - 80px); margin: 0 auto; object-fit: contain; }
.md-lightbox__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-card); font-size: 22px; line-height: 1; cursor: pointer; }
.md-lightbox__open { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--navy); }

/* ---------- Редактор ---------- */
.md-editor { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.md-editor__box { border: 1px solid var(--border); border-radius: var(--radius-field); background: var(--surface); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.md-editor__box:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(10, 190, 240, .25); }
.md-editor--invalid .md-editor__box, .md-editor--upload-invalid .md-editor__box { border-color: var(--danger); }
.md-editor.is-dragover .md-editor__box { border-color: var(--navy); background: var(--navy-soft); }
.md-editor__bar { display: none; }
.js .md-editor__bar { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 4px 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-field) var(--radius-field) 0 0; }
.md-editor__tabs { display: flex; flex-shrink: 0; gap: 2px; }
.md-editor__tab { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font: 500 13px/1 var(--font-heading); color: var(--text-2); cursor: pointer; }
.md-editor__tab:hover { color: var(--text); }
.md-editor__tab.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 0 0 1px var(--border); }
.md-editor__tab:focus-visible, .md-tool:focus-visible, .md-menu__item:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.md-editor__toolbar { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 1px; min-width: 0; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--border); }
.md-tool { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text); cursor: pointer; font: 600 14px/1 var(--font-heading); }
.md-tool:hover:not(:disabled), .md-tool[aria-expanded="true"], .md-tool[aria-pressed="true"] { background: var(--surface); color: var(--navy); box-shadow: 0 0 0 1px var(--border); }
.md-tool:disabled { opacity: .4; cursor: default; }
.md-tool--text b, .md-tool--text i, .md-tool--text s { font-family: var(--font-heading); font-size: 15px; }
.md-toolbar__sep { flex-shrink: 0; width: 1px; height: 18px; margin: 0 4px; background: var(--border-strong); }
.md-toolbar__spacer { flex: 1; min-width: 4px; }
.md-tool-group { display: inline-flex; flex-shrink: 0; }
.md-menu { position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 160px; max-height: 300px; padding: 4px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); }
.md-menu[hidden] { display: none; }
.md-menu__item { padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; font: 500 14px/1.2 var(--font-sans); color: var(--text); cursor: pointer; white-space: nowrap; }
.md-menu__item:hover, .md-menu__item:focus-visible { background: var(--navy-soft); color: var(--navy); }
.md-menu__item--h2 { font: 600 17px/1.2 var(--font-heading); }
.md-menu__item--h3 { font: 600 15px/1.2 var(--font-heading); }
.md-menu__item--h4 { font: 600 14px/1.2 var(--font-heading); }
.md-editor__write { position: relative; }
.md-editor__write[hidden] { display: none; }
.md-editor .md-editor__write textarea, .field .md-editor .md-editor__write textarea {
  display: block; width: 100%; min-height: 140px; height: auto; padding: 12px 14px; border: 0; border-radius: 0; box-shadow: none;
  background: transparent; resize: vertical; font: 14px/1.55 var(--font-sans); color: var(--text);
}
.md-editor .md-editor__write textarea:focus { outline: none; box-shadow: none; border: 0; }
.md-editor .md-editor__write textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
.md-editor--compact .md-editor__write textarea { min-height: 96px; }
.md-editor__preview { min-height: 140px; padding: 12px 14px; }
.md-editor__preview[hidden] { display: none; }
.md-editor--compact .md-editor__preview { min-height: 96px; }
.md-editor__foot { display: none; }
.js .md-editor__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 2px 10px 6px; }
.md-help { font-size: 12px; color: var(--text-2); }
.md-help > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; }
.md-help > summary::-webkit-details-marker { display: none; }
.md-help[open] > summary { color: var(--navy); }
.md-help__body { max-width: 560px; margin-top: 6px; }
.md-help__table { border-collapse: collapse; margin-bottom: 6px; }
.md-help__table td { padding: 2px 10px 2px 0; }
.md-help__table code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); }
.md-editor .dropzone { margin-top: 2px; }
.md-editor--fullscreen { position: fixed; inset: 0; z-index: 50; padding: 16px; background: var(--bg); }
.md-editor--fullscreen .md-editor__box { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.md-editor--fullscreen .md-editor__write, .md-editor--fullscreen .md-editor__preview { flex: 1; min-height: 0; overflow: auto; }
.md-editor--fullscreen .md-editor__write textarea { height: 100% !important; resize: none; }
.md-editor--fullscreen .file-picks { max-height: 30vh; overflow-y: auto; }
html.md-fullscreen-open { overflow: hidden; }
.md-editor .file-pick { border-radius: 12px; padding: 4px 4px 4px 4px; max-width: 100%; }
.file-pick__thumb { width: 40px; height: 40px; flex-shrink: 0; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.file-pick__type { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font: 600 10px/1 var(--font-heading); text-transform: uppercase; color: var(--navy); }
.file-pick__body { display: flex; flex-direction: column; min-width: 0; gap: 1px; padding-right: 4px; }
.file-pick__error { font-size: 12px; font-weight: 500; color: var(--danger); }
.file-pick--error { border-color: var(--danger); background: var(--danger-soft); }
.description-body { color: var(--text); }
@media (max-width: 640px) {
  .js .md-editor__bar { flex-wrap: wrap; }
  .md-editor__tabs { flex: 1 0 100%; }
  /* На телефоне панель — одна строка с горизонтальной прокруткой. */
  .md-editor__toolbar { flex: 1 0 100%; flex-wrap: nowrap; margin: 2px 0 0; padding: 2px 0 0; border-left: 0; border-top: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .md-tool { width: 36px; height: 34px; }
  .md-editor__tab { height: 32px; flex: 1; }
  .md-editor--fullscreen { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .md-editor__box { transition: none; } }
