/* Листайка — листы на печать.
   Палитра и шапка приходят из /common.css, здесь только своё. */

.shell {
  display: grid;
  grid-template-columns: minmax(304px, 348px) 1fr;
  align-items: start;
}

/* ---------- панель ---------- */

.controls {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field[hidden] { display: none; }

.field-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

/* ---------- плитки типов ---------- */

.types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tile {
  appearance: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--sheet);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1.2;
}
.tile .tile-icon { width: 22px; height: 22px; color: var(--ink-3); }
.tile:hover { border-color: var(--ink-3); color: var(--ink); }
.tile:hover .tile-icon { color: var(--rule); }
.tile[aria-pressed="true"] {
  background: var(--rule);
  border-color: var(--rule);
  color: #fff;
}
.tile[aria-pressed="true"] .tile-icon { color: #fff; }
.tile:focus-visible { outline: 2px solid var(--rule); outline-offset: 2px; }

/* ---------- поля ---------- */

select, input[type="text"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 10px;
}
select:focus-visible, input:focus-visible { outline: 2px solid var(--rule); outline-offset: 1px; }

.toggles { display: flex; flex-direction: column; gap: 8px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle input { accent-color: var(--rule); width: 15px; height: 15px; flex: 0 0 auto; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- листы ---------- */

.stage {
  padding: 30px 24px 52px;
  background: var(--desk-2);
  min-height: 100vh;
}
.sheets {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}
.sheet {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sheet);
}
.sheet svg { display: block; width: 100%; height: auto; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .controls {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

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

@media print {
  @page { size: A4 portrait; margin: 0; }

  html, body { background: #fff; margin: 0; padding: 0; }
  .topbar, .controls { display: none !important; }
  .shell { display: block; }
  .stage { padding: 0; background: #fff; min-height: 0; }
  .sheets { display: block; gap: 0; }

  .sheet {
    max-width: none;
    width: 210mm;
    height: 297mm;
    box-shadow: none;
    border: 0;
    margin: 0;
    break-after: page;
    page-break-after: always;
    overflow: hidden;
  }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sheet svg { width: 210mm; height: 297mm; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
