/* Адмінка qr.nkz.com.ua. Один макет під ПК і телефон: мінімальна перевірена
   ширина 360 px, зверху обмежує max-width, а не розтягування на весь екран.
   Інлайнових стилів тут немає — на цьому хості діє CSP зі script-src 'self'. */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #333;
  background: #f0f2f5;
  -webkit-text-size-adjust: 100%;
}

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  /* dvh — щоб адресний рядок мобільного браузера не зрізав кнопку входу */
  min-height: 100dvh;
}

.shell { width: 100%; max-width: 1100px; }
body.centered .shell { max-width: 400px; }
body.centered .shell:has(.wide) { max-width: 460px; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

h1 {
  margin: 0 0 4px;
  font-size: 1.35em;
  color: #1a1a2e;
}

.hint {
  margin: 0 0 18px;
  color: #888;
  font-size: .88em;
  line-height: 1.45;
}

.warn {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #ffd8a8;
  color: #8a5300;
  font-size: .88em;
  line-height: 1.45;
}

.error {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #a12622;
  font-size: .9em;
}

/* ── Форми ── */

.auth label {
  display: block;
  margin: 14px 0 5px;
  font-size: .78em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.auth input[type="email"],
.auth input[type="password"],
.auth input[type="text"] {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  font-size: 16px;   /* менше 16px — і iOS Safari зумить сторінку на фокусі */
  color: #222;
  background: #fff;
}

.auth input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, .18);
}

button,
.btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;     /* ≥44 px висоти — ціль для пальця */
  border: none;
  border-radius: 8px;
  background: #1a56db;
  color: #fff;
  font-size: 1em;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.btn:hover { background: #1746b0; }
button:active,
.btn:active { transform: translateY(1px); }

/* ── 2FA ── */

.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin: 4px 0 16px;
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 10px;
}

.qr-box svg {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.secret {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f7fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  color: #1a56db;
  text-align: center;
  word-break: break-all;
  user-select: all;
}

.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.codes li {
  padding: 10px 8px;
  border-radius: 8px;
  background: #f5f7fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em;
  text-align: center;
  user-select: all;
}

@media (max-width: 420px) {
  body { padding: 12px; }
  .card { padding: 22px 18px; }
  .codes { grid-template-columns: 1fr; }
}

/* ══ Навігація ═══════════════════════════════════════════════════════════════ */

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.nav .brand {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: #1a1a2e;
  color: #fff;
  font-weight: 700;
  font-size: .85em;
  text-decoration: none;
  letter-spacing: .5px;
}

.nav-links {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  /* На вузькому екрані посилання не переносяться, а скролються: два ряди
     навігації з'їдають екран телефона більше, ніж горизонтальний зсув. */
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 7px;
  color: #444;
  font-size: .88em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { background: #f0f2f5; }

.nav-out { flex-shrink: 0; margin: 0; }
.nav-out button {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #d8dce3;
  background: #f7f8fa;
  color: #444;
  font-size: .85em;
  font-weight: 400;
}
.nav-out button:hover { background: #eef0f4; }

/* ══ Сторінки ════════════════════════════════════════════════════════════════ */

.page-head { margin-bottom: 16px; }
.page-head h1 { margin-bottom: 2px; }

.back {
  display: inline-block;
  margin-bottom: 12px;
  color: #1a56db;
  font-size: .9em;
  text-decoration: none;
}
.back:hover { text-decoration: underline; }

.notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e7f6ec;
  border: 1px solid #b7e0c4;
  color: #1c6b35;
  font-size: .9em;
}

.empty {
  padding: 28px;
  border-radius: 12px;
  background: #fff;
  color: #888;
  text-align: center;
}

.card + .card, .card + .toolbar, .toolbar + table { margin-top: 16px; }
.card.narrow { max-width: 460px; }
.card h2 {
  margin: 0 0 14px;
  font-size: .8em;
  color: #16213e;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ══ Форми ═══════════════════════════════════════════════════════════════════ */

.create > summary {
  cursor: pointer;
  font-weight: 600;
  color: #1a56db;
  list-style: none;
}
.create > summary::-webkit-details-marker { display: none; }
.create[open] > summary { margin-bottom: 16px; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.field.wide { grid-column: 1 / -1; }

.field label {
  display: block;
  margin: 0 0 5px;
  font-size: .78em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.field input,
.field select,
.card.auth select {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  font-size: 16px;   /* менше 16px — і iOS Safari зумить сторінку на фокусі */
  color: #222;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, .18);
}

.fhint { display: block; margin: 4px 0 0; color: #999; font-size: .78em; line-height: 1.4; }
.fhint.center { text-align: center; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; }
.check span { font-size: .92em; }

.inline-form { margin-top: 14px; }
.inline-form button { width: auto; margin-top: 10px; }

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

.btn-sm {
  display: inline-block;
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #d8dce3;
  border-radius: 7px;
  background: #f7f8fa;
  color: #444;
  font-size: .82em;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn-sm:hover { background: #eef0f4; }

.btn-warn { background: #b45309; }
.btn-warn:hover { background: #92400e; }
.btn-danger { background: #b3261e; color: #fff; border-color: #b3261e; }
.btn-danger:hover { background: #8c1d18; }
button:disabled, .btn-sm:disabled { opacity: .5; cursor: not-allowed; }

.row-actions, .lcard-actions, .qr-dl, .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.row-actions form, .lcard-actions form, .toolbar form { margin: 0; }
.row-actions button, .lcard-actions button { margin: 0; }

.danger { border: 1px solid #f0d4d2; }
.danger h2 { color: #a12622; }

/* ══ Таблиці й картки ════════════════════════════════════════════════════════ */

table {
  width: 100%;
  margin-bottom: 20px;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
th {
  padding: 10px 14px;
  background: #1a1a2e;
  color: #fff;
  font-size: .78em;
  font-weight: 600;
  text-align: left;
}
td { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; font-size: .88em; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }
tr.off td { opacity: .55; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td.target { max-width: 280px; }
td.target span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
}

.slug {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: #e8f0fe;
  color: #1a56db;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  text-decoration: none;
}
.slug.big { font-size: .8em; padding: 4px 12px; }

.tag {
  display: inline-block;
  padding: 2px 7px;
  margin-right: 4px;
  border-radius: 4px;
  background: #f0f2f5;
  color: #666;
  font-size: .72em;
  white-space: nowrap;
}
.tag.on { background: #e7f6ec; color: #1c6b35; }
.tag.warn { background: #fdecea; color: #a12622; }
.tag.lock { background: #fff4e5; color: #8a5300; }

.cards-list { display: flex; flex-direction: column; gap: 8px; }

.lcard {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.lcard.off { opacity: .6; }
.lcard summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 48px;   /* ціль для пальця */
}
.lcard summary::-webkit-details-marker { display: none; }
.lcard summary::after {
  content: '›';
  margin-left: auto;
  color: #bbb;
  font-size: 1.3em;
  line-height: 1;
  transition: transform .15s;
}
.lcard[open] summary::after { transform: rotate(90deg); }
.lcard-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9em; }
.lcard-num { color: #1a1a2e; font-weight: 700; }
.lcard-body { padding: 4px 14px 14px; border-top: 1px solid #f0f0f0; }
.lcard-body .f { display: flex; flex-direction: column; margin-top: 10px; }
.fl { font-size: .7em; color: #aaa; text-transform: uppercase; letter-spacing: .4px; }
.fv { font-size: .88em; color: #333; margin-top: 2px; }
.break { word-break: break-all; }
.lcard-actions { margin-top: 14px; }

.sessions { margin: 0 0 16px; padding: 0; list-style: none; }
.sessions li {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.sessions li:last-child { border-bottom: none; }

/* ══ QR ══════════════════════════════════════════════════════════════════════ */

.qr-opts > summary { cursor: pointer; margin-top: 14px; color: #1a56db; font-size: .85em; }
.qr-dl { margin-top: 12px; }

/* ══ Друк ════════════════════════════════════════════════════════════════════ */

.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.print-cell {
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 10px;
  text-align: center;
  break-inside: avoid;
}
.print-qr svg { width: 100%; max-width: 160px; height: auto; }
.print-cell figcaption { display: block; margin-top: 8px; }
.print-cell figcaption b { display: block; font-size: .9em; }
.print-cell figcaption span { display: block; margin-top: 2px; color: #888; font-size: .72em; word-break: break-all; }

@media print {
  body { background: #fff; padding: 0; }
  .nav, .no-print, .notice { display: none !important; }
  .print-cell { border-color: #ccc; box-shadow: none; }
  .print-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* ══ Перемикання ПК / телефон ════════════════════════════════════════════════ */
/* Мінімальна перевірена ширина — 360 px. Таблиця на 7-8 колонок там нечитабельна,
   тому нижче 760 px ті самі записи показуються згорнутими картками. */

.only-narrow { display: none; }

@media (max-width: 760px) {
  .only-wide { display: none; }
  .only-narrow { display: block; }
  .only-narrow.cards-list { display: flex; }
  .two-col { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .nav { border-radius: 0; margin: -20px -20px 16px; }
}

@media (max-width: 420px) {
  .nav { margin: -12px -12px 12px; }
}

/* ════════════════════════════════════════════════════════════════════════
   Сторінки керування (фаза 4). Один макет під ПК і телефон: перемикає
   медіазапит на 700 px, а не окремі сторінки.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Навігація ── */

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto 18px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.nav .brand {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: #1a1a2e;
  color: #fff;
  font-weight: 700;
  font-size: .82em;
  letter-spacing: 1px;
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;              /* на вузькому екрані пункти прокручуються, */
  -webkit-overflow-scrolling: touch;   /* а не переносяться і не ріжуться */
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 7px;
  color: #444;
  font-size: .88em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover { background: #f0f2f5; }

.nav-out { flex-shrink: 0; margin: 0; }
.nav-out button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #d8dce3;
  border-radius: 7px;
  background: #f7f8fa;
  color: #444;
  font-size: .85em;
  font-weight: 400;
}
.nav-out button:hover { background: #eef0f4; }

/* Дашборд успадковує max-width від dashboard.css, тому свій відступ не потрібен */
body.dashboard .nav { margin-left: 0; margin-right: 0; }

/* ── Заголовок сторінки, повідомлення ── */

.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 1.4em; }

.notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e8f5e9;
  border: 1px solid #b7e0bb;
  color: #1e5b24;
  font-size: .9em;
}

.back {
  display: inline-block;
  margin-bottom: 14px;
  color: #1a56db;
  font-size: .9em;
  text-decoration: none;
}
.back:hover { text-decoration: underline; }

.empty {
  padding: 30px 20px;
  border-radius: 10px;
  background: #fff;
  color: #888;
  text-align: center;
}

.card + .card, .card + .toolbar, .toolbar + table { margin-top: 16px; }
.card.narrow { max-width: 480px; }
.card h2 {
  margin: 0 0 14px;
  font-size: .82em;
  color: #16213e;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Форми ── */

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.field.wide { grid-column: 1 / -1; }

.field label,
.card label:not(.check) {
  display: block;
  margin: 0 0 5px;
  font-size: .78em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.field input,
.field select,
.card input[type="url"],
.card input[type="date"],
.card select {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  font-size: 16px;    /* менше 16px — і iOS Safari зумить сторінку на фокусі */
  color: #222;
  background: #fff;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, .18);
}

.field input:disabled { background: #f3f4f6; color: #999; }

.fhint {
  display: block;
  margin: 5px 0 0;
  color: #999;
  font-size: .78em;
  line-height: 1.4;
}
.fhint.center { text-align: center; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 0 0;
  font-size: .92em;
  cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 0; }

details.create > summary {
  padding: 14px 16px;
  font-weight: 600;
  color: #1a56db;
  cursor: pointer;
  list-style: none;
}
details.create > summary::-webkit-details-marker { display: none; }
details.create[open] > summary { border-bottom: 1px solid #f0f0f0; margin-bottom: 18px; }
details.create { padding: 0; }
details.create form { padding: 0 16px 18px; }

.inline-form { margin-top: 14px; }

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

.btn-sm {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 7px 12px;      /* у рядку таблиці; на телефоні ціль збільшена нижче */
  border: 1px solid #d8dce3;
  border-radius: 7px;
  background: #f7f8fa;
  color: #333;
  font-size: .82em;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}
.btn-sm:hover { background: #eef0f4; }

.btn-warn  { background: #f59f00; }
.btn-warn:hover { background: #e08e00; }
.btn-danger { background: #c92a2a; }
.btn-danger:hover { background: #a52020; }
.btn-sm.btn-danger { background: #fdecea; border-color: #f5c2c0; color: #a12622; }
.btn-sm.btn-danger:hover { background: #fadbd8; }

.card.danger { border: 1px solid #f0d0d0; }
.card.danger h2 { color: #a12622; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Таблиці ── */

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
th {
  padding: 10px 12px;
  background: #1a1a2e;
  color: #fff;
  font-size: .78em;
  font-weight: 600;
  text-align: left;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: .87em;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr.off td { opacity: .55; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.nowrap { white-space: nowrap; }

td.target {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #777;
}

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }

.slug {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #1a56db;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em;
  text-decoration: none;
}
.slug.big { font-size: 1em; padding: 4px 12px; }

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f0f2f5;
  color: #777;
  font-size: .74em;
  white-space: nowrap;
}
.tag.on   { background: #e8f5e9; color: #2b7a33; }
.tag.warn { background: #fdecea; color: #a12622; }
.tag.lock { background: #fff4e5; color: #8a5300; }

/* ── Картки-рядки (телефон) ── */

.cards-list { display: flex; flex-direction: column; gap: 8px; }

.lcard {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  overflow: hidden;
}
.lcard.off { opacity: .6; }

.lcard summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  min-height: 44px;         /* ціль для пальця */
}
.lcard summary::-webkit-details-marker { display: none; }
.lcard summary::after {
  content: '›';
  margin-left: auto;
  color: #bbb;
  font-size: 1.3em;
  line-height: 1;
  transition: transform .15s;
}
.lcard[open] summary::after { transform: rotate(90deg); }

.lcard-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9em;
  color: #444;
}
.lcard-num { font-weight: 700; color: #1a1a2e; }

.lcard-body { padding: 4px 14px 14px; border-top: 1px solid #f0f0f0; }
.lcard-body .f { display: flex; flex-direction: column; margin-top: 10px; }
.fl { font-size: .7em; color: #aaa; text-transform: uppercase; letter-spacing: .4px; }
.fv { font-size: .88em; color: #333; margin-top: 2px; }
.break { word-break: break-all; }

.lcard-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.lcard-actions form { margin: 0; }
.lcard-actions .btn-sm { padding: 11px 14px; }   /* ≥44 px висоти на телефоні */

/* ── QR ── */

.qr-dl { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.qr-opts { margin-top: 16px; }
.qr-opts > summary {
  font-size: .85em;
  color: #1a56db;
  cursor: pointer;
  padding: 6px 0;
}

/* ── Сесії ── */

.sessions { margin: 0 0 16px; padding: 0; list-style: none; }
.sessions li {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sessions li:last-child { border-bottom: none; }

/* ── Перемикання ПК / телефон ── */

.only-narrow { display: none; }

@media (max-width: 700px) {
  .only-wide { display: none; }
  .only-narrow { display: flex; }
  .two-col { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .nav { border-radius: 0; margin: -20px -20px 16px; padding: 8px; }
  body { padding: 20px 12px; }
  .page-head h1 { font-size: 1.2em; }
}

/* ── Друк ── */

.print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.print-cell {
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 10px;
  text-align: center;
  break-inside: avoid;      /* QR не має розриватись між сторінками */
}
.print-qr svg { width: 100%; max-width: 160px; height: auto; }
.print-cell figcaption { display: block; margin-top: 8px; }
.print-cell figcaption b { display: block; font-size: .9em; }
.print-cell figcaption span {
  display: block;
  margin-top: 2px;
  color: #888;
  font-size: .72em;
  word-break: break-all;
}

@media print {
  body { background: #fff; padding: 0; }
  .nav, .no-print, .notice { display: none !important; }
  .print-cell { border-color: #ccc; box-shadow: none; }
  .print-grid { gap: 10px; }
}

.qr-cmp { margin: 10px 0; font-size: .85em; }
.qr-cmp th { padding: 7px 10px; font-size: .72em; }
.qr-cmp td { padding: 7px 10px; }
.qr-cmp .fhint { display: inline; }
