/* Дашборд Хаб — интерфейс управления.
   Шрифт Golos Text (OFL, см. golos-OFL.txt). Акцент — фиолетовый с ягодным оттенком;
   зелёный — опубликовано, янтарный — есть неопубликованная версия, красный — необратимое. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/assets/golos-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-display: swap;
  font-weight: 400 900;
  src: url("/assets/golos-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 {
  color-scheme: light;
  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --ink: #1e1a22;
  --ink-2: #3d3644;
  --muted: #645c6b;
  --placeholder: #8a828f;
  --line: #e8e4eb;
  --line-2: #d6d0db;
  --line-hover: #bdb5c3;
  --canvas: #f6f4f7;
  --surface: #ffffff;
  --hover: #f9f7fa;
  --press: #efebf1;

  --accent: #742a8a;
  --accent-hover: #5f2172;
  --accent-press: #4e1b5e;
  --accent-soft: #f5edf7;
  --focus: #8a3fa3;

  --live: #1f6b47;
  --live-soft: #edf6f0;
  --live-line: #c3e0cd;
  --pending: #8a5300;
  --pending-soft: #fcf5e7;
  --pending-line: #eed6a6;
  --danger: #b3362b;
  --danger-hover: #962c22;
  --danger-soft: #fcefed;
  --danger-line: #efc7c1;

  --radius: 6px;
  --radius-lg: 10px;
  --container: 1120px;
  --gutter: 32px;
  --header: 60px;
  --pad: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header) + 16px);
  background: var(--canvas);
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
::selection {
  background: #e7d4ee;
}
.num {
  font-variant-numeric: tabular-nums;
}
.icon {
  flex-shrink: 0;
  display: block;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transform: translateY(-200%);
}
.skip-link:focus-visible {
  transform: none;
}

/* ——— Контейнер и шапка ——— */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  display: block;
}
.main-nav {
  display: flex;
  align-self: stretch;
  gap: 4px;
  min-width: 0;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}
.nav-link[aria-current="page"] {
  color: var(--ink);
}
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.nav-link:focus-visible {
  outline-offset: -4px;
  border-radius: 8px;
}
.account {
  position: relative;
  margin-left: auto;
  /* The name's text, not its hover area, lines up with the content edge. */
  margin-right: -12px;
  min-width: 0;
}
.account-button {
  display: block;
  max-width: 260px;
  height: 36px;
  padding: 0 12px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-button:hover,
.account-button[aria-expanded="true"] {
  background: var(--press);
}
.menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(30 26 34 / 0.12);
}
.menu-head {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.menu-head strong {
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.menu-head span {
  color: var(--muted);
  font-size: 13px;
}
.menu-item {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--press);
  outline: none;
}

/* ——— Страница ——— */
.main-content {
  padding-top: 32px;
  padding-bottom: 80px;
}
.main-content:focus {
  outline: none;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  min-height: 40px;
  margin-bottom: 20px;
}
.page-head > div {
  min-width: 0;
}
.page-title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.page-lead {
  margin-top: 6px;
  max-width: 72ch;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 12px -3px;
  color: var(--muted);
  font-size: 14px;
}
.crumb:hover {
  color: var(--ink);
  text-decoration: none;
}
.boot {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  min-height: 100vh;
  color: var(--muted);
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ——— Кнопки ——— */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.button:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--line-hover);
  text-decoration: none;
}
.button:active:not(:disabled) {
  background: var(--press);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.button.primary:active:not(:disabled) {
  background: var(--accent-press);
}
.button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}
.button.danger:hover:not(:disabled) {
  border-color: var(--danger-hover);
  background: var(--danger-hover);
}
/* Text buttons keep a hover area but align their text with the surrounding text. */
.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.button.quiet:hover:not(:disabled) {
  border-color: transparent;
  background: var(--press);
  color: var(--ink);
}
.button.quiet.danger-text {
  color: var(--danger);
}
.button.quiet.danger-text:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger-hover);
}
.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.button.wide {
  width: 100%;
}
.icon-button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}
.icon-button:hover {
  background: var(--press);
  color: var(--ink);
}

/* ——— Поля ——— */
.form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field > label,
.field-label {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
input[type="text"],
input[type="password"],
input[type="search"],
input:not([type]),
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-hover);
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(138 63 163 / 0.18);
  outline: none;
}
input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}
input[readonly] {
  background: var(--hover);
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%23645c6b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.input-row {
  display: flex;
  gap: 8px;
}
.input-row > input {
  flex: 1;
  min-width: 0;
}
.input-row > .button {
  flex-shrink: 0;
  min-height: 40px;
}
.form-error {
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
}

/* ——— Вход ——— */
.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px 16px;
}
.login-wrap {
  width: 100%;
  max-width: 360px;
}
.login-brand {
  margin: 0 0 20px;
  font-size: 16px;
}
.login-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.login-card h1 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.login-card .button {
  margin-top: 4px;
}

/* ——— Панели ——— */
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px var(--pad);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.panel-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.panel-body {
  flex: 1;
  padding: var(--pad);
}
.panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  /* Quiet buttons carry 10px of their own padding: their text starts at --pad. */
  padding: 10px calc(var(--pad) - 10px);
  border-top: 1px solid var(--line);
}
.main-content > .panel + .panel {
  margin-top: 20px;
}

/* Состояние публикации окрашивает рамку и шапку панели. */
.publish-panel.is-live {
  border-color: var(--live-line);
}
.publish-panel.is-live .panel-head {
  border-bottom-color: var(--live-line);
  background: var(--live-soft);
}
.publish-panel.is-pending {
  border-color: var(--pending-line);
}
.publish-panel.is-pending .panel-head {
  border-bottom-color: var(--pending-line);
  background: var(--pending-soft);
}

/* ——— Состояние: цветной текст, без плашек и точек ——— */
.status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.status.live {
  color: var(--live);
}
.status.pending {
  color: var(--pending);
}
.status.off {
  color: var(--danger);
}
.status.draft {
  color: var(--ink-2);
}

/* ——— Список проектов ——— */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}
.search {
  position: relative;
  width: 340px;
  max-width: 100%;
}
.search .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--placeholder);
  transform: translateY(-50%);
  pointer-events: none;
}
.search input {
  padding-left: 38px;
}
.summary {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.list-head,
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px 170px;
  gap: 24px;
  align-items: center;
  padding-inline: var(--pad);
}
.list-head {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.project-row {
  min-height: 64px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.list > li:last-child > .project-row {
  border-bottom: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.project-row:hover {
  background: var(--hover);
  text-decoration: none;
}
.project-row:focus-visible {
  outline-offset: -2px;
  border-radius: 4px;
}
.row-main {
  min-width: 0;
}
.row-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.project-row:hover .row-title {
  text-decoration: underline;
  text-decoration-color: var(--line-hover);
  text-underline-offset: 3px;
}
.row-sub {
  display: -webkit-box;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}
.row-date {
  color: var(--muted);
  font-size: 14px;
}
.empty-state {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 32px var(--pad);
}
.empty-state h2 {
  font-size: 17px;
  font-weight: 600;
}
.empty-state p {
  max-width: 56ch;
  color: var(--muted);
}
.storage {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.storage.is-high {
  color: var(--pending);
  font-weight: 500;
}

/* ——— Страница проекта ——— */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}
.detail-head > div {
  min-width: 0;
}
.detail-head .button {
  flex-shrink: 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  /* Both working panels share one height: their bottoms line up. */
  align-items: stretch;
  margin-bottom: 20px;
}
.file-card {
  margin-bottom: 16px;
}
.file-name {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.file-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}
.file-meta .status {
  font-size: 14px;
}
.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
  padding: 22px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
.dropzone:hover:not(:disabled),
.dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .icon {
  color: var(--accent);
}
.dropzone strong {
  font-size: 15px;
  font-weight: 600;
}
.dropzone span {
  color: var(--muted);
  font-size: 13px;
}
.dropzone.is-first {
  padding-block: 36px;
}
.upload-progress {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--hover);
}
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.upload-progress-head strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-progress-head span {
  color: var(--muted);
}
.bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s;
}
.bar.is-indeterminate > span {
  width: 35%;
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}
.publish-body {
  display: grid;
  align-content: start;
  gap: 16px;
}
.publish-body > .button {
  justify-self: start;
}
.publish-text {
  color: var(--ink-2);
}
.publish-text.is-pending {
  color: var(--pending);
}
.link-field {
  display: grid;
  gap: 6px;
}
.link-field input {
  font-size: 14px;
  text-overflow: ellipsis;
}
.link-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 4px;
  font-size: 14px;
}
.link-meta a {
  font-weight: 500;
}
.link-meta span {
  color: var(--muted);
  font-size: 13px;
}
.uploader {
  display: grid;
  gap: 10px;
}

/* ——— Таблицы ——— */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.table th {
  height: 42px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: var(--pad);
}
.table th:last-child,
.table td:last-child {
  padding-right: var(--pad);
}
.table td.cell-end {
  padding-right: calc(var(--pad) - 10px);
  text-align: right;
  white-space: nowrap;
}
.table .cell-muted {
  color: var(--muted);
}
.table .only-narrow {
  display: none;
}
.cell-title {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cell-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.cell-sub.status {
  font-size: 13px;
}
.versions .cell-file {
  width: 46%;
}
.versions tr.is-removed .cell-title {
  color: var(--muted);
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: var(--line-hover);
}

/* Журнал: события по дням. */
.day {
  padding: 10px var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--hover);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}
.event,
.event-list-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 16px;
  padding-inline: var(--pad);
}
.event {
  align-items: baseline;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.panel > .event:last-child {
  border-bottom: 0;
}
.event-list-head {
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.event-time {
  color: var(--muted);
}
.event-what {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.event-what span {
  color: var(--muted);
  font-weight: 400;
}
.event-project {
  overflow-wrap: anywhere;
}
.event-who {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* Специалисты. */
.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.self-note {
  padding-right: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ——— Диалоги ——— */
dialog {
  width: min(calc(100vw - 32px), 440px);
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(30 26 34 / 0.2);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: rgb(30 26 34 / 0.4);
}
.dialog-form {
  display: grid;
  gap: 16px;
  padding: 22px 24px 24px;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-right: -8px;
}
.dialog-head h2 {
  padding-top: 3px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.dialog-text {
  color: var(--ink-2);
  font-size: 15px;
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* ——— Уведомления ——— */
.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 12px 32px rgb(30 26 34 / 0.24);
}
.toast.is-error {
  background: #8e2a20;
}
.toast .icon-button {
  width: 30px;
  height: 30px;
  color: rgb(255 255 255 / 0.7);
}
.toast .icon-button:hover {
  background: rgb(255 255 255 / 0.12);
  color: #fff;
}

/* ——— Адаптивность ——— */
@media (max-width: 960px) {
  .list-head,
  .project-row {
    grid-template-columns: minmax(0, 1fr) 170px 150px;
    gap: 16px;
  }
}
@media (max-width: 840px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  :root {
    --gutter: 16px;
    --header: 56px;
    --pad: 16px;
  }
  input[type="text"],
  input[type="password"],
  input[type="search"],
  input:not([type]),
  select,
  textarea {
    font-size: 16px;
  }
  .header-inner {
    flex-wrap: wrap;
    gap: 0 12px;
    height: auto;
    padding-top: 8px;
  }
  .brand {
    height: 40px;
  }
  .account {
    order: 2;
  }
  .account-button {
    max-width: 44vw;
  }
  .main-nav {
    order: 3;
    flex-basis: calc(100% + 2 * var(--gutter));
    height: 44px;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: calc(var(--gutter) - 12px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .main-content {
    padding-top: 22px;
    padding-bottom: 56px;
  }
  .page-title {
    font-size: 22px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .search {
    width: 100%;
  }
  .list-head {
    display: none;
  }
  .project-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "main main"
      "status date";
    gap: 8px 12px;
    padding-block: 14px;
  }
  .row-main {
    grid-area: main;
  }
  .row-status {
    grid-area: status;
  }
  .row-date {
    grid-area: date;
    justify-self: end;
    font-size: 13px;
  }
  .row-sub {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .detail-head {
    flex-direction: column;
  }
  .link-field .input-row {
    flex-wrap: wrap;
  }
  .link-field .input-row > input {
    flex-basis: 100%;
  }
  .link-field .input-row > .button {
    flex: 1;
  }
  /* Таблицы версий и специалистов складываются в карточки. */
  .stack-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .stack-table,
  .stack-table tbody {
    display: block;
  }
  .stack-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 14px var(--pad);
    border-bottom: 1px solid var(--line);
  }
  .stack-table tr:last-child {
    border-bottom: 0;
  }
  .table.stack-table td {
    display: block;
    grid-column: 1 / -1;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .table.stack-table .only-wide {
    display: none;
  }
  .table.stack-table td.cell-lead {
    grid-column: 1;
    grid-row: 1;
  }
  .table.stack-table td.cell-end {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-right: -10px;
  }
  .table.stack-table td.cell-end:empty {
    display: none;
  }
  .table.stack-table td.cell-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    margin: 6px 0 0 -10px;
  }
  .table.stack-table td.cell-actions .row-actions {
    justify-content: flex-start;
  }
  .stack-table .cell-muted {
    font-size: 13px;
  }
  .event-list-head {
    display: none;
  }
  .event {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 2px 12px;
  }
  .event-what,
  .event-project,
  .event-who {
    grid-column: 2;
  }
  .event-project:empty {
    display: none;
  }
  .event-project,
  .event-who {
    font-size: 13px;
  }
  .event-who {
    color: var(--muted);
  }
  .toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
    max-width: none;
  }
  .dialog-form {
    padding: 20px;
  }
  .dialog-actions .button {
    flex: 1 1 auto;
  }
  .login-card {
    padding: 22px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
