/* ======================================================================
   Стиль исследовательской работы (экран + печать A4).
   Шрифт Times New Roman, кегль 14, полуторный интервал — как принято в школе.
   ====================================================================== */
:root { --accent: #5b4bdb; --ink: #141414; --soft: #555; --line: #c9c9c9; }

* { box-sizing: border-box; }
body {
  font-family: "Times New Roman", "Liberation Serif", Georgia, serif;
  font-size: 14pt; line-height: 1.5; color: var(--ink);
  background: #eceef3; margin: 0;
}
.page {
  background: #fff; width: 210mm; min-height: 297mm; margin: 14px auto;
  padding: 20mm 18mm 18mm 25mm; box-shadow: 0 2px 14px rgba(0,0,0,.14);
}
p { margin: 0 0 8px; text-align: justify; }
h1, h2, h3 { font-weight: bold; color: #111; line-height: 1.25; }
h1 { font-size: 17pt; margin: 0 0 12px; }
h2 { font-size: 15pt; margin: 20px 0 8px; }
h3 { font-size: 14pt; margin: 14px 0 6px; }
.center { text-align: center; }
ul, ol { margin: 4px 0 10px; padding-left: 26px; }
li { margin: 2px 0; }
b, strong { font-weight: bold; }
.muted { color: var(--soft); }
code, .mono { font-family: "Cascadia Code", Consolas, monospace; font-size: 12.5pt; background: #f0f0f4; padding: 0 4px; border-radius: 3px; }

/* ---- Титульная страница ---- */
.cover { display: flex; flex-direction: column; min-height: 257mm; text-align: center; }
.cover .org { font-size: 14pt; margin-bottom: 2px; }
.cover .top { margin-bottom: auto; }
.cover .mid { margin: auto 0; }
.cover .subject { font-size: 13pt; color: var(--soft); margin-bottom: 18px; }
.cover .theme { font-size: 22pt; font-weight: bold; line-height: 1.3; margin: 10px 0; }
.cover .kind { font-size: 13pt; color: var(--soft); }
.cover .who { margin-top: auto; text-align: right; font-size: 13.5pt; line-height: 1.6; }
.cover .who .row { margin: 2px 0; }
.cover .city { margin-top: 26px; font-size: 13pt; }

/* ---- Формулы и врезки ---- */
.formula { text-align: center; font-size: 16pt; margin: 12px 0; font-family: "Cambria Math", "Times New Roman", serif; }
.formula .frac { display: inline-block; vertical-align: middle; text-align: center; }
.formula .frac .num { display: block; border-bottom: 1.5px solid #111; padding: 0 6px; }
.formula .frac .den { display: block; padding: 0 6px; }
.callout { border-left: 3px solid var(--accent); background: #f4f3fc; padding: 8px 14px; margin: 12px 0; border-radius: 4px; }
.callout.tip { border-color: #16a34a; background: #eef8f1; }

/* ---- Рисунки и таблицы ---- */
figure { margin: 14px 0; text-align: center; page-break-inside: avoid; }
figure img { max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
figcaption { font-size: 12pt; color: var(--soft); margin-top: 6px; text-align: center; }
figcaption b { color: #111; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5pt; margin: 10px 0; page-break-inside: avoid; }
table.tbl th, table.tbl td { border: 1px solid #999; padding: 5px 8px; text-align: center; }
table.tbl th { background: #eceaf9; }
table.tbl td.l, table.tbl th.l { text-align: left; }
.tbl-cap { font-size: 12pt; color: var(--soft); text-align: left; margin: 10px 0 2px; }

/* ---- Оглавление ---- */
.toc a { color: #111; text-decoration: none; }
.toc .line { display: flex; justify-content: space-between; border-bottom: 1px dotted #bbb; margin: 4px 0; }

/* ---- Печать ---- */
@page { size: A4; margin: 18mm 15mm 16mm 22mm; }
@media print {
  body { background: #fff; font-size: 13pt; }
  .page { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 0; }
  .page + .page { page-break-before: always; }
  .no-print { display: none !important; }
  h2 { page-break-after: avoid; }
  figure, table.tbl { page-break-inside: avoid; }
}
.toolbar { position: sticky; top: 0; background: #1c1f2b; color: #fff; padding: 8px 16px; text-align: center; font-family: Arial, sans-serif; font-size: 13px; z-index: 5; }
.toolbar a { color: #a5b4fc; }

/* ---- Мобильные устройства (экран): читается без горизонтального скролла ---- */
@media screen and (max-width: 820px) {
  body { font-size: 16px; }
  .page { width: auto; min-height: 0; margin: 0 0 10px; padding: 18px 16px; box-shadow: none; border-bottom: 6px solid #eceef3; }
  h1 { font-size: 21px; } h2 { font-size: 18px; } h3 { font-size: 16px; }
  .cover { min-height: 86vh; }
  .cover .theme { font-size: 27px; }
  table.tbl { font-size: 13px; }
  .formula { font-size: 18px; }
  .toolbar { font-size: 12px; padding: 7px 10px; }
}
