/*
 * Халатик — статический контентный слой.
 * Стили страниц, которые собирает web/content/build.mjs. Один файл на весь
 * раздел: CSP разрешает только свои стили и Google Fonts, JS страниц — отдельно.
 */

:root {
  --blue: #2196f3;
  --blue-light: #64b5f6;
  --blue-dark: #1565c0;
  --teal: #00acc1;
  --teal-light: #4dd0e1;

  --bg: #eff8fc;
  --surface: #ffffff;
  --surface-raised: #e8f4fa;

  --text: #0d2137;
  --text-muted: #456b7e;

  --ok: #26a69a;
  --warn: #ffa726;
  --danger: #ef5350;

  --border: #d3e7f2;
  --border-strong: #b9dced;

  --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Comfortaa', 'Onest', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(13, 33, 55, 0.06), 0 2px 8px rgba(13, 33, 55, 0.04);
  --shadow: 0 6px 28px rgba(21, 101, 192, 0.09);

  --wrap: 1120px;
  --measure: 74ch;
}

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

/* Скрытие через атрибут hidden должно побеждать display у блока:
   иначе .up-warnings (display: grid) остаётся видимой пустой плашкой. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  /* Полоса-градиент вверху страницы: фирменный «медицинский» акцент. */
  background-image: linear-gradient(180deg, #dcefff 0, rgba(220, 239, 255, 0) 420px);
}

img { max-width: 100%; height: auto; }

a {
  color: var(--blue-dark);
  text-decoration-color: rgba(21, 101, 192, 0.32);
  text-underline-offset: 3px;
}

a:hover { color: var(--blue); text-decoration-color: currentColor; }

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus { left: 0; color: #fff; }

/* ------------------------------------------------------------- шапка --- */

.site-header {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-block: 10px;
}

.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { display: block; height: 26px; width: auto; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 600;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}

.header-nav a:hover {
  color: var(--blue-dark);
  border-bottom-color: var(--teal);
}

/* -------------------------------------------------------- хлебные крошки --- */

.crumbs { padding-block: 18px 6px; }

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.crumbs li + li::before {
  content: '/';
  color: var(--border-strong);
  margin-right: 8px;
}

.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue-dark); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

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

main { display: block; padding-bottom: 72px; }

.page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4.2vw, 56px);
  overflow: hidden;
}

.page > * { max-width: var(--measure); }
.page > .upload,
.page > .tool,
.page > .cta,
.page > .related { max-width: none; }

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(27px, 4.6vw, 44px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--text);
  text-wrap: balance;
}

.lead {
  font-size: clamp(17.5px, 2.1vw, 21px);
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 22px;
  padding-left: clamp(14px, 2vw, 20px);
  border-left: 4px solid var(--teal);
  text-wrap: pretty;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.page-meta span {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-raised);
  white-space: nowrap;
}

.meta-badge {
  background: rgba(255, 167, 38, 0.15);
  color: #8a5100;
  font-weight: 600;
  white-space: normal !important;
}

.block { margin-block: 0 38px; }

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(21px, 2.9vw, 28px);
  line-height: 1.25;
  margin: 0 0 14px;
  color: var(--text);
  position: relative;
  padding-left: 18px;
  text-wrap: balance;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blue) 0%, var(--teal-light) 100%);
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(17px, 2.1vw, 19.5px);
  line-height: 1.3;
  margin: 26px 0 8px;
  color: var(--blue-dark);
}

p { margin: 0 0 15px; text-wrap: pretty; }

ul, ol { margin: 0 0 18px; padding-left: 0; }

.list-plain { list-style: none; }

.list-plain li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
}

.list-plain li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.list-ordered {
  list-style: none;
  counter-reset: step;
}

.list-ordered li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 11px;
}

.list-ordered li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: var(--surface-raised);
  color: var(--blue-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist {
  list-style: none;
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: linear-gradient(180deg, #fbfdff, #f3fafd);
}

.checklist li {
  position: relative;
  padding: 10px 12px 10px 42px;
  border-radius: var(--radius-sm);
}

.checklist li:hover { background: rgba(33, 150, 243, 0.06); }

.checklist li::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--blue-light);
  border-radius: 5px;
  background: #fff;
}

.note {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(0, 172, 193, 0.08);
  border: 1px solid rgba(0, 172, 193, 0.28);
  border-left-width: 5px;
}

.note p { margin: 0; font-size: 16px; }

.note-inline {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 167, 38, 0.13);
  font-size: 15px;
}

/* -------------------------------------------------------------- таблицы --- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 480px;
  font-size: 15.5px;
}

caption {
  caption-side: top;
  text-align: left;
  padding: 13px 16px 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

thead th {
  background: linear-gradient(180deg, var(--blue-dark), #1a6fc9);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}

tbody td {
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:nth-child(even) td { background: #f7fbfe; }
tbody tr:hover td { background: rgba(33, 150, 243, 0.07); }

tbody td:first-child { font-weight: 600; white-space: nowrap; }
tbody td:last-child:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------- загрузка своего бланка --- */

.upload {
  margin: 0 0 34px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(77, 208, 225, 0.25) 0%, rgba(77, 208, 225, 0) 52%),
    linear-gradient(135deg, #123d66 0%, #1565c0 100%);
  color: #eaf5ff;
  box-shadow: var(--shadow);
}

.upload-head { padding: clamp(20px, 3.4vw, 30px) clamp(16px, 3vw, 30px) 4px; }
.upload-head h2 { color: #fff; padding-left: 0; margin-bottom: 8px; }
.upload-head h2::before { display: none; }

.upload-sub {
  margin: 0;
  color: rgba(234, 245, 255, 0.85);
  font-size: 15.5px;
  max-width: 64ch;
}

.upload-body { padding: clamp(16px, 3vw, 26px); }

.drop-zone {
  border: 2px dashed rgba(159, 220, 255, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  padding: clamp(20px, 4vw, 34px) 18px;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.drop-zone.is-over {
  border-color: var(--teal-light);
  border-style: solid;
  background: rgba(77, 208, 225, 0.18);
}

.drop-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(16.5px, 2.2vw, 19px);
  color: #fff;
  margin: 0 0 6px;
}

.drop-or {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: rgba(234, 245, 255, 0.65);
  text-transform: lowercase;
}

.drop-pick { margin: 0 0 14px; }

.drop-pick .btn {
  background: #fff;
  color: var(--blue-dark);
  box-shadow: none;
}

.drop-pick .btn:hover { background: #eaf5ff; color: var(--blue-dark); }

/* Поле файла скрыто визуально, но доступно с клавиатуры: нажатие идёт через <label for>. */
.drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.drop-input:focus-visible + .drop-hint,
.drop-pick .btn:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }

.drop-hint {
  margin: 0;
  font-size: 13.5px;
  color: rgba(234, 245, 255, 0.7);
}

.up-status {
  margin: 14px 0 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #9fdcff;
}

.up-status:empty { display: none; }
.up-status[data-kind='error'] { color: #ffc4c2; }
.up-status[data-kind='warn'] { color: #ffd79a; }

[data-widget='upload-preview'][data-busy='yes'] .drop-zone {
  opacity: 0.6;
  pointer-events: none;
}

.up-empty,
.up-result {
  margin-top: 16px;
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
}

.up-empty p { margin: 0; color: var(--text-muted); }
.up-empty strong { color: var(--text); }

.up-kind {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(38, 166, 154, 0.15);
  color: #14695f;
  font-size: 13.5px;
  font-weight: 700;
}

.up-doctitle {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17.5px;
  color: var(--text);
}

.up-doctitle:empty { display: none; }

.up-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
}

.up-stats li {
  flex: 1 1 110px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.up-stats b {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1.1;
  color: var(--blue-dark);
  overflow-wrap: anywhere;
}

.up-stats span { font-size: 12.5px; color: var(--text-muted); }

.up-result h3 { margin: 0 0 10px; }

.up-fields-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
}

.up-fields-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-light);
  border-radius: var(--radius-sm);
  background: #f7fbfe;
  min-width: 0;
}

.up-field-label { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.up-field-hint { font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }

.up-more { margin: 0 0 12px; font-size: 13.5px; color: var(--text-muted); }

.up-warnings {
  list-style: none;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 167, 38, 0.13);
  font-size: 14px;
  display: grid;
  gap: 6px;
}

.up-cta { margin: 6px 0 0; }

/* --------------------------------------------------------- конструктор --- */

.tool {
  margin: 0 0 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tool-head {
  padding: clamp(18px, 3vw, 26px) clamp(16px, 3vw, 28px);
  background: linear-gradient(135deg, #e7f4ff 0%, #e3f7fa 100%);
  border-bottom: 1px solid var(--border);
}

.tool-head h2 { margin: 0 0 8px; padding-left: 0; }
.tool-head h2::before { display: none; }

.tool-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 62ch;
}

.tool-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-end;
  margin: 0;
  padding: clamp(16px, 3vw, 24px) clamp(16px, 3vw, 28px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  flex: 1 1 210px;
  min-width: 0;
}

.field-narrow { flex: 0 1 150px; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.field select,
.field input[type='date'],
.field input[type='number'] {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
}

.field select:hover,
.field input:hover { border-color: var(--blue-light); }

.field-check {
  flex: 1 1 210px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 44px;
}

.field-check input { width: 19px; height: 19px; accent-color: var(--blue); flex: none; }
.field-check label { font-size: 14.5px; color: var(--text); font-weight: 500; }

.field-submit { flex: 0 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 600;
  padding: 12px 22px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(33, 150, 243, 0.28);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(33, 150, 243, 0.34);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: #fff;
  color: var(--blue-dark);
  border-color: var(--border-strong);
}

.btn-ghost:hover { background: var(--surface-raised); border-color: var(--blue-light); }

.tool-status {
  margin: 0;
  padding: 0 clamp(16px, 3vw, 28px);
  font-size: 14px;
  color: var(--ok);
  font-weight: 600;
  min-height: 0;
}

.tool-status:empty { display: none; }
.tool-status[data-kind='error'] { color: var(--danger); }

.tool-result { padding: 4px clamp(16px, 3vw, 28px) clamp(16px, 3vw, 24px); }

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.tool-result .table-wrap { margin-bottom: 12px; }
.tool-result table { min-width: 420px; }

/* В строках-продолжениях дня ячейки даты нет, поэтому первой оказывается
   «содержание работы»: общее правило для первой колонки тут выключаем. */
.tool-result tbody td {
  font-weight: 400;
  white-space: normal;
  text-align: left;
  width: auto;
}

.tool-result tbody td.cell-date {
  white-space: nowrap;
  width: 1%;
  font-weight: 600;
  background: #f3fafd;
}

.tool-result tbody td.cell-qty {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 1%;
}

.tool-hint {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------- FAQ --- */

.faq-item {
  border-top: 1px solid var(--border);
  padding: 16px 0 4px;
}

.faq-item:first-of-type { border-top: none; }
.faq-item h3 { margin: 0 0 6px; color: var(--text); font-size: 17.5px; }
.faq-item p { margin: 0; color: var(--text-muted); }

/* --------------------------------------------------------------- CTA --- */

.cta {
  margin: 44px 0 38px;
  padding: clamp(22px, 3.4vw, 34px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(77, 208, 225, 0.35) 0%, rgba(77, 208, 225, 0) 55%),
    linear-gradient(135deg, #123d66 0%, #1565c0 100%);
  color: #eaf5ff;
}

.cta h2 { color: #fff; padding-left: 0; margin-bottom: 10px; }
.cta h2::before { display: none; }
.cta p { color: rgba(234, 245, 255, 0.86); max-width: 62ch; }
.cta-links { margin: 18px 0 8px; }
.cta .btn-primary { background: #fff; color: var(--blue-dark); box-shadow: none; }
.cta .btn-primary:hover { background: #eaf5ff; color: var(--blue-dark); }
.cta-soft { margin: 0; font-size: 15.5px; }
.cta-soft a { color: #9fdcff; font-weight: 600; }
.cta-soft a:hover { color: #fff; }

/* ---------------------------------------------------------- Ещё по теме --- */

.rel-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.rel-list a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f7fbfe);
  text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.16s ease;
}

.rel-list a:hover {
  transform: translateY(-2px);
  border-color: var(--blue-light);
  box-shadow: var(--shadow);
}

.rel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  color: var(--blue-dark);
  line-height: 1.3;
}

.rel-desc { font-size: 14px; color: var(--text-muted); line-height: 1.45; }

/* -------------------------------------------------------------- подвал --- */

.site-footer {
  background: #0d2137;
  color: #a9c4d6;
  padding: clamp(32px, 5vw, 52px) 0 28px;
  font-size: 14.5px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 26px 34px;
  padding-bottom: 28px;
}

.foot-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin: 0 0 12px;
  padding-left: 0;
}

.foot-title::before { display: none; }

.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: #cfe3f1; text-decoration: none; }
.foot-grid a:hover { color: #fff; text-decoration: underline; }

.foot-legal {
  border-top: 1px solid rgba(169, 196, 214, 0.22);
  padding-top: 22px;
  display: grid;
  gap: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #8fadc2;
}

.foot-disclaimer { margin: 0; max-width: 78ch; }
.foot-req { margin: 0; }
.foot-req a { color: #9fdcff; }
.foot-copy { margin: 0; color: #6f8ea4; }

/* ---------------------------------------------------------- адаптивность --- */

@media (max-width: 760px) {
  body { font-size: 16.5px; }

  .header-inner { min-height: 56px; }
  .header-nav { width: 100%; margin-left: 0; font-size: 14px; gap: 4px 14px; }

  .page {
    border-radius: var(--radius);
    padding: 20px 16px 26px;
  }

  .page-meta { gap: 6px; }
  .lead { border-left-width: 3px; }
  .tool-form { gap: 12px; }
  .field, .field-narrow, .field-check, .field-submit { flex: 1 1 100%; }
  .field-submit .btn { width: 100%; }
  .cta { margin-inline: 0; }
  .rel-list { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .page { padding: 18px 13px 24px; }
  table { font-size: 14.5px; }
  thead th, tbody td { padding: 9px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rel-list a:hover, .btn-primary:hover { transform: none; }
}

/* ---------------------------------------------------------------- печать --- */

@media print {
  body { background: #fff; font-size: 12pt; }
  .site-header, .site-footer, .crumbs, .skip-link,
  .tool-form, .tool-actions, .tool-status, .cta, .related, .note, .faq { display: none !important; }
  .page { box-shadow: none; border: none; padding: 0; }
  .page > * { max-width: none; }
  .table-wrap { overflow: visible; border: none; }
  table { min-width: 0; }
  thead th { background: #e8f4fa !important; color: #0d2137 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tbody tr { break-inside: avoid; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #456b7e; }

  /* Печать по кнопке конструктора: на листе остаётся только собранная таблица.
     Класс ставит /content/dnevnik.js на время печати, поэтому вне печати правил нет. */
  .printing-tool .page > *:not(.tool) { display: none !important; }
  .printing-tool .tool { border: none; box-shadow: none; }
  .printing-tool .tool-head { background: none; border-bottom: none; padding: 0 0 8px; }
  .printing-tool .tool-result { padding: 0; }
}
