/*
 * Админка приложения 7IS. Цвета — токены бренда из oqu-mobile/src/theme/colors.ts (они же на сайте,
 * oqu-frontend/src/app/styles.css), новых значений здесь нет. Шрифты Medeo и Caveat — с сайта, лицензия OFL
 * рядом в fonts/. Вход — тёмно-зелёная доска, как у сайта и приложения.
 */

@font-face {
  font-family: "7IS Medeo Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/MedeoSansVariable.woff2") format("woff2");
}
@font-face {
  font-family: "7IS Medeo Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/MedeoMonoVariable.woff2") format("woff2");
}
@font-face {
  font-family: "7IS Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/Caveat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "7IS Caveat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/Caveat-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;
  --bg: #f7f6ef;
  --surface: #fbfaf5;
  --surface-hover: #eef0e8;
  --surface-sunk: #e9ebe2;
  --surface-muted: #f2f3ec;
  --input: #ffffff;
  --border: #dcded3;
  --border-strong: #c5c9bb;
  --text: #1a1a1a;
  --text-secondary: #4a564f;
  --text-muted: #5b6f65;
  --accent-text: #0f4a3a;
  --accent-soft: #e6ede7;
  --accent-faint: #d2ddd6;
  --cta: #0f4a3a;
  --cta-hover: #0a3a2d;
  --cta-active: #072f24;
  --cta-ink: #f7f6ef;
  --logo: #0f4a3a;
  --focus: #0f4a3a;
  --ring: rgb(15 74 58 / 14%);
  --emerald: #12996b;
  --emerald-soft: #e4f6ee;
  --emerald-deep: #0b6f4d;
  --emerald-border: #b7e4cf;
  --rose: #d92b56;
  --rose-soft: #ffe7ee;
  --rose-faint: #fff3f6;
  --rose-text: #b21d47;
  --rose-deep: #a5164a;
  --rose-border: #f7c3d0;
  --rose-ink: #ffffff;
  --amber: #e0930f;
  --amber-soft: #fff3d9;
  --amber-deep: #8a5b06;
  --amber-border: #f3d99a;

  --board: #0f4a3a;
  --chalk: rgb(247 246 239 / 26%);
  --chalk-strong: rgb(247 246 239 / 50%);
  --chalk-line: rgb(247 246 239 / 28%);
  --chalk-greeting: rgb(247 246 239 / 92%);

  --font: "7IS Medeo Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "7IS Medeo Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --font-chalk: "7IS Caveat", "Segoe Script", cursive;

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --z-sticky: 10;
  --z-skip: 20;
}

/* Тёмная тема — только у рабочих экранов: доска и карточка входа одни на обе темы, как на сайте. */
@media (prefers-color-scheme: dark) {
  .app {
    color-scheme: dark;
    --bg: #0b1b17;
    --surface: #10241e;
    --surface-hover: #163029;
    --surface-sunk: #081310;
    --surface-muted: #0e201b;
    --input: #081310;
    --border: #1f3a32;
    --border-strong: #2b4a41;
    --text: #f7f6ef;
    --text-secondary: #cfd8d2;
    --text-muted: #9bada5;
    --accent-text: #b3c6bd;
    --accent-soft: #16302a;
    --accent-faint: #1e3f36;
    --cta: #f7f6ef;
    --cta-hover: #ffffff;
    --cta-active: #e9e8e0;
    --cta-ink: #0f4a3a;
    --logo: #f7f6ef;
    --focus: #b3c6bd;
    --ring: rgb(179 198 189 / 22%);
    --emerald: #4fd6a8;
    --emerald-soft: #122e28;
    --emerald-deep: #4fd6a8;
    --emerald-border: #1f4a3a;
    --rose: #ff849e;
    --rose-soft: #331722;
    --rose-faint: #2a121c;
    --rose-text: #ff849e;
    --rose-deep: #ff9fb3;
    --rose-border: #5c2b3a;
    --rose-ink: #0b1b17;
    --amber: #f2b23e;
    --amber-soft: #33270f;
    --amber-deep: #f2b23e;
    --amber-border: #5a4418;
  }
}

/* ---------- Основа ---------- */

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

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);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
code, pre { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute;
  z-index: var(--z-skip);
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--cta);
  color: var(--cta-ink);
  transform: translateY(-160%);
}
.skip:focus-visible { transform: none; }
.skip:hover { color: var(--cta-ink); }

.muted { color: var(--text-muted); }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Кнопки ---------- */

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent-text);
  font: 500 15px / 1.3 var(--font);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--cta); color: var(--cta-ink); }
.button-primary:hover { background: var(--cta-hover); color: var(--cta-ink); }
.button-primary:active { background: var(--cta-active); }
.button-secondary { border-color: var(--border-strong); background: var(--surface); }
.button-secondary:hover { background: var(--surface-hover); color: var(--accent-text); }
.button-quiet:hover { background: var(--surface-hover); color: var(--accent-text); }
.button-danger { background: var(--rose); color: var(--rose-ink); }
.button-danger:hover { background: var(--rose-deep); color: var(--rose-ink); }
.button-block { width: 100%; min-height: 48px; }
.button-small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.is-locked { opacity: 0.5; cursor: not-allowed; }

.link-button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
.link-button:hover { color: var(--text); }

/* ---------- Верхняя полоса ---------- */

.topbar {
  position: sticky;
  z-index: var(--z-sticky);
  top: 0;
  display: flex;
  flex-wrap: wrap;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding: 0 max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-start { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; }
.topbar-end { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar-end form { display: contents; }
.tabs { display: flex; align-self: stretch; gap: 4px; }
.tab {
  display: flex;
  min-height: 64px;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.tab:hover { background: var(--surface-hover); color: var(--text); }
.tab[aria-current="page"] { color: var(--accent-text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent-text); }
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background-color 150ms var(--ease-out);
}
.me:hover, .me[aria-current="page"] { background: var(--surface-hover); color: var(--text); }
.me-text { display: flex; flex-direction: column; line-height: 1.2; }
.me-name { font-weight: 500; }
.me-note { color: var(--text-muted); font-size: 12px; }

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}
.avatar-self { background: var(--cta); color: var(--cta-ink); }
.avatar-large { width: 40px; height: 40px; font-size: 15px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 31px;
  height: 24px;
  flex: none;
  background: var(--logo);
  mask: url("mark.svg") center / contain no-repeat;
  -webkit-mask: url("mark.svg") center / contain no-repeat;
}
.brand-name { font-weight: 500; }

/* ---------- Страница ---------- */

.page {
  display: flex;
  max-width: 1088px;
  flex-direction: column;
  gap: 40px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.notices { display: flex; flex-direction: column; gap: 8px; margin-bottom: -16px; }
.notice {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--text);
  animation: rise 220ms var(--ease-out) both;
}
.notice-success { border-color: var(--emerald-border); background: var(--emerald-soft); color: var(--emerald-deep); }
.notice-warning { border-color: var(--amber-border); background: var(--amber-soft); color: var(--amber-deep); }
.notice-error { border-color: var(--rose-border); background: var(--rose-soft); color: var(--rose-text); }

/* ---------- Состояние приложения ---------- */

.state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.state-text { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.state h1 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; line-height: 1.25; }
.state p { max-width: 70ch; color: var(--text-secondary); overflow-wrap: anywhere; }
.state-dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px var(--emerald-soft);
}
.state-partial { border-color: var(--amber-border); background: var(--amber-soft); }
.state-partial .state-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-border); }
.state-closed { border-color: var(--rose-border); background: var(--rose-soft); }
.state-closed h1 { color: var(--rose-text); }
.state-closed .state-dot { background: var(--rose); box-shadow: 0 0 0 4px var(--rose-border); }
.state-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.state-actions form { display: contents; }

/* ---------- Разделы ---------- */

.block { display: flex; flex-direction: column; gap: 14px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.block-head h2, .payload h2 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.block-note { color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- Сборки ---------- */

.builds {
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  list-style: none;
}
.build { position: relative; }
.build + .build { border-top: 1px solid var(--border); }
.build-row {
  display: grid;
  grid-template-columns: 120px auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 16px 220px 16px 24px;
}
.build-name { font-size: 17px; font-weight: 600; }
.build-numbers { display: flex; flex-wrap: wrap; gap: 8px 48px; margin: 0; }
.build-numbers div { display: flex; flex-direction: column; gap: 2px; }
.build-numbers dt { color: var(--text-muted); font-size: 13px; }
.build-meaning { max-width: 44ch; color: var(--text-secondary); font-size: 14px; line-height: 1.45; }
.build-numbers dd {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
}

.release > summary {
  position: absolute;
  top: 28px;
  right: 24px;
  list-style: none;
}
.release > summary::-webkit-details-marker { display: none; }
.release .when-open, .release[open] .when-closed { display: none; }
.release[open] .when-open { display: inline; }
.release-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 24px;
  border-top: 1px dashed var(--border-strong);
  background: var(--surface-muted);
  animation: rise 200ms var(--ease-out) both;
}
.build:last-child .release-form { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.release-fields { display: grid; max-width: 560px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.release-fields input { font-size: 17px; font-variant-numeric: tabular-nums; }

.confirm {
  display: flex;
  max-width: 640px;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--amber-border);
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--text);
}
.confirm-question { color: var(--amber-deep); font-weight: 500; }

/* ---------- Школы ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.schools { width: 100%; min-width: 640px; border-collapse: collapse; }
.schools th, .schools td { padding: 14px 16px; text-align: left; vertical-align: middle; }
.schools thead th {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.schools tbody tr + tr { border-top: 1px solid var(--border); }
.schools tbody tr { transition: background-color 150ms var(--ease-out); }
.schools tbody tr:hover { background: var(--surface-hover); }
.schools tbody th { font-weight: 500; }
.schools tbody th a { color: var(--accent-text); }
.schools code { color: var(--text-secondary); font-size: 13px; }
.cell-host { color: var(--text-secondary); font-family: var(--font-mono); font-size: 13px; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-on { background: var(--emerald-soft); color: var(--emerald-deep); }
.tag-warn { background: var(--amber-soft); color: var(--amber-deep); }
.tag-error { background: var(--rose-soft); color: var(--rose-text); }
.tag-accent { background: var(--accent-soft); color: var(--accent-text); }
.tag-plain, .tag-muted { background: var(--surface-sunk); color: var(--text-secondary); }
.text-warn { color: var(--amber-deep); }

.school-cell { display: flex; align-items: center; gap: 12px; }
.school-badge {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---------- Журнал ---------- */

.changes {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.changes li {
  display: grid;
  grid-template-columns: 128px 120px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.changes li:first-child { border-top: 1px solid var(--border); }
.changes time { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.changes-who { overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.changes-what { overflow-wrap: anywhere; }
.changes-what strong { font-weight: 500; }
.changes .changes-empty { display: block; color: var(--text-muted); }

/* ---------- Что получает приложение ---------- */

.payload { display: flex; flex-direction: column; }
.payload > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 4px 0;
  list-style: none;
  cursor: pointer;
}
.payload > summary::-webkit-details-marker { display: none; }
.payload > summary::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  content: "";
  transform: rotate(-45deg);
  transition: transform 180ms var(--ease-out);
}
.payload[open] > summary::before { transform: rotate(45deg); }
.payload > summary:hover h2 { color: var(--accent-text); }
.payload .block-note { margin: 8px 0 12px; }
.json {
  max-height: 440px;
  margin: 0;
  overflow: auto;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-sunk);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  animation: rise 200ms var(--ease-out) both;
}

/* ---------- Формы ---------- */

.form-head { display: flex; flex-direction: column; gap: 12px; }
.form-head h1 { font-size: 24px; font-weight: 600; line-height: 1.25; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.back { width: fit-content; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--accent-text); text-decoration: underline; }
.lead { max-width: 65ch; color: var(--text-secondary); font-size: 16px; }
.lead code { font-size: 14px; }
.stack { display: flex; flex-direction: column; gap: 32px; }
.stack-tight { display: flex; flex-direction: column; gap: 20px; }
.split { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px; margin-top: -16px; }
.split-main { min-width: 0; flex: 999 1 520px; }
.split-aside { position: sticky; top: 88px; display: flex; max-width: 320px; flex: 1 1 280px; flex-direction: column; gap: 10px; }
.aside-title { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.aside-note { color: var(--text-muted); font-size: 13px; }

.group { display: flex; min-width: 0; flex-direction: column; gap: 16px; margin: 0; padding: 0; border: 0; }
.group legend { margin-bottom: 4px; padding: 0; font-size: 17px; font-weight: 600; }
.group-note { max-width: 65ch; color: var(--text-muted); font-size: 13px; }
.row-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.row-narrow { max-width: 200px; }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.row-limited { max-width: 640px; }
.indent { display: flex; flex-direction: column; gap: 16px; padding-left: 30px; }
.field input.input-readonly { background: var(--surface-sunk); color: var(--text-secondary); font-family: var(--font-mono); font-size: 14px; }
.field input[name$="api_url"], .field input[name="id"] { font-family: var(--font-mono); font-size: 14px; }

.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field label { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.optional { color: var(--text-muted); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--text);
  font: 400 15px / 1.4 var(--font);
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.field textarea { min-height: 72px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); opacity: 1; }
.field input:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus, .field textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--rose); }
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--input) inset; -webkit-text-fill-color: var(--text); }
.field-help { color: var(--text-muted); font-size: 13px; }
.field-error, .form-error { color: var(--rose-text); font-size: 13px; }
.form-error {
  padding: 12px 16px;
  border: 1px solid var(--rose-border);
  border-radius: var(--radius);
  background: var(--rose-faint);
  font-size: 14px;
}

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--cta); }
.check-text { display: flex; flex-direction: column; gap: 2px; }
.check-title { font-weight: 500; }
.check-note { color: var(--text-muted); font-size: 13px; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.choices-limited { max-width: 760px; }
.group legend.legend-small { color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--focus); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--cta); }
.choice-text { display: flex; flex-direction: column; gap: 2px; }
.choice-title { font-weight: 500; }
.choice-note { color: var(--text-muted); font-size: 13px; }
.group-invalid .choice { border-color: var(--rose-border); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aside-action { margin-top: 16px; padding-top: 24px; border-top: 1px solid var(--border); }

/* ---------- Вход: доска ---------- */

.login {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow-x: clip;
  padding: 48px 24px 64px;
  background: var(--board);
  isolation: isolate;
}
.board {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  background:
    radial-gradient(ellipse 40% 30% at 18% 22%, rgb(247 246 239 / 5%), transparent 70%),
    radial-gradient(ellipse 35% 25% at 80% 75%, rgb(247 246 239 / 4.5%), transparent 70%),
    radial-gradient(ellipse 30% 20% at 70% 15%, rgb(247 246 239 / 3%), transparent 70%);
}
.chalk-shape { position: absolute; top: var(--y); left: var(--x); width: var(--size); height: var(--size); overflow: visible; }
.chalk-stroke {
  fill: none;
  stroke: var(--chalk-line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: chalk-draw 1.6s ease-out var(--delay, 0s) both;
}
.chalk-dot { fill: var(--chalk-strong); }
.chalk-text {
  position: absolute;
  top: var(--y);
  left: var(--x);
  color: var(--chalk);
  font: 500 clamp(22px, 2vw, 30px) / 1 var(--font-chalk);
  white-space: nowrap;
  text-shadow: 0 0 1px rgb(255 255 255 / 35%);
  transform: rotate(-3deg);
  animation: chalk-in 600ms ease-out var(--delay, 0s) both;
}

.login-main { display: flex; width: 100%; flex-direction: column; align-items: center; gap: 28px; }
.greeting {
  max-width: 100%;
  color: var(--chalk-greeting);
  font: 600 clamp(44px, 6vw, 80px) / 1 var(--font-chalk);
  text-align: center;
  text-shadow: 0 0 1px rgb(255 255 255 / 70%), 1px 1px 0 rgb(247 246 239 / 25%), 0 0 10px rgb(247 246 239 / 18%);
  transform: rotate(-2deg);
  animation: chalk-in 500ms ease-out both;
}
.login-card {
  display: flex;
  width: min(440px, 100%);
  flex-direction: column;
  gap: 20px;
  padding: 32px 36px 36px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 45%);
  animation: appear 420ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}
.login-mark {
  width: 72px;
  height: 56px;
  align-self: center;
  background: var(--logo);
  mask: url("mark.svg") center / contain no-repeat;
  -webkit-mask: url("mark.svg") center / contain no-repeat;
}
.login-head { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.login-head h1 { font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; }
.login-head p { color: var(--text-muted); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field input { min-height: 48px; }
.login-form .button-block { margin-top: 4px; }
.login-error {
  padding: 12px 14px;
  border: 1px solid var(--rose-border);
  border-radius: var(--radius);
  background: var(--rose-faint);
  color: var(--rose-text);
  font-size: 14px;
}

/* ---------- Движение ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes appear {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes chalk-in {
  from { opacity: 0; filter: blur(4px); }
  to { opacity: 1; filter: blur(0); }
}
@keyframes chalk-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chalk-stroke { stroke-dashoffset: 0; }
  .button:active { transform: none; }
}

/* ---------- Узкий экран ---------- */

@media (max-width: 760px) {
  .topbar { padding-inline: 16px; }
  .tab { min-height: 48px; }
  .me-text { display: none; }
  .split-aside { position: static; max-width: none; }
  .indent { padding-left: 0; }
  .page { gap: 32px; padding: 24px 16px 64px; }
  .build-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px 16px 8px; min-height: 0; }
  .build-meaning { max-width: none; }
  .build-numbers { gap: 8px 32px; }
  .build-numbers dd { font-size: 28px; }
  .release > summary { position: static; margin: 4px 16px 16px; }
  .release-form { padding: 16px; }
  .release-fields { grid-template-columns: minmax(0, 1fr); }
  .changes li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .state { padding: 16px; }
  .chalk-shape, .chalk-extra { display: none; }
  .login { padding: 32px 16px 48px; }
  .login-card { padding: 28px 20px 24px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
}
