:root {
  --color-bg: #0f1220;
  --color-surface: #1a1e33;
  --color-surface-2: #232948;
  --color-primary: #7c3aed;
  --color-primary-dark: #5b21b6;
  --color-accent: #f59e0b;
  --color-danger: #ef4444;
  --color-success: #22c55e;
  --color-text: #f1f2f8;
  --color-text-dim: #a6acc7;
  --color-border: #323a5e;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-width: 640px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body { padding-bottom: calc(72px + var(--safe-bottom)); }

h1, h2, h3, p { margin: 0; }

.app-shell { display: flex; }
.app-content { flex: 1; min-width: 0; }

/* ---------- Desktop sidebar nav ---------- */
.side-nav { display: none; }

.app-header__actions { display: flex; align-items: center; gap: 10px; }
.app-header__icon-btn {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-header__icon-btn:active { transform: scale(.92); }
.app-header__icon-btn.is-active { background: var(--color-accent); color: #3a2504; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.app-header__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header__brand { display: flex; align-items: center; gap: 8px; }
.app-header__logo { font-size: 22px; }
.app-header__title { font-size: 18px; font-weight: 700; }
.app-header__game { font-size: 13px; background: rgba(255,255,255,.18); padding: 4px 10px; border-radius: 999px; }

.app-main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card[hidden] { display: none; }
.card.is-manual-target { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent) inset; }
.card__header { display: flex; align-items: center; justify-content: space-between; }
.card__header h2 { font-size: 15px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: .04em; }
.card__header.collapsible { cursor: pointer; }
.chevron { transition: transform .2s ease; color: var(--color-text-dim); }
.chevron.is-open { transform: rotate(180deg); }

.badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
}
.badge--prize { background: var(--color-accent); color: #3a2504; }

/* ---------- Draw stage ---------- */
.draw-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 0 4px;
}

.draw-ball {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7e6, var(--color-accent) 55%, #b8790a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3a2504;
  box-shadow: 0 10px 30px rgba(245, 158, 11, .35), inset 0 -6px 14px rgba(0,0,0,.15);
  transition: transform .15s ease;
}
.draw-ball.is-bouncing { animation: bounce .4s ease; }
@keyframes bounce {
  0% { transform: scale(.85) rotate(-4deg); }
  60% { transform: scale(1.08) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}
.draw-ball.is-awaiting-reveal {
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--color-accent), 0 10px 30px rgba(245, 158, 11, .35), inset 0 -6px 14px rgba(0,0,0,.15);
  animation: pulse-reveal 1.4s ease-in-out infinite;
}
@keyframes pulse-reveal {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.draw-ball__letter {
  font-size: var(--ball-letter-size, 20px);
  font-weight: var(--ball-font-weight, 800);
  letter-spacing: .05em;
}
.draw-ball__number {
  font-size: var(--ball-number-size, 42px);
  font-weight: var(--ball-font-weight, 800);
  line-height: 1;
}

.draw-stats { color: var(--color-text-dim); font-size: 14px; }
.draw-stats--secondary { color: var(--color-accent); font-weight: 700; }
.hint--manual { color: var(--color-accent); font-weight: 600; text-align: center; }
.hint--suspense { color: var(--color-accent); font-weight: 600; text-align: center; }

.btn {
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 18px;
  cursor: pointer;
  color: #fff;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--small { padding: 8px 14px; font-size: 13px; border-radius: 9px; flex-shrink: 0; }
.btn--xl { font-size: 18px; padding: 18px 24px; border-radius: 16px; }
.btn--primary { background: var(--color-primary); }
.btn--secondary { background: var(--color-surface-2); border: 1px solid var(--color-border); }
.btn--danger { background: transparent; border: 1.5px solid var(--color-danger); color: var(--color-danger); }
.btn--ghost { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn--manual { color: var(--color-text); }
.btn--manual.is-active { background: var(--color-accent); color: #3a2504; border-color: var(--color-accent); }
.btn-group { display: flex; flex-direction: column; gap: 10px; }
.btn-group[hidden] { display: none; }
.btn-row { display: flex; gap: 10px; width: 100%; }
.btn-row .btn--primary { flex: 2; }
.btn-row .btn--manual { flex: 1; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-direction: column;
  line-height: 1;
}
.chip small { font-size: 8px; color: var(--color-text-dim); font-weight: 600; }
.chip--latest { background: var(--color-accent); color: #3a2504; border-color: var(--color-accent); }

.empty-hint { color: var(--color-text-dim); font-size: 13px; }

/* ---------- Draw board ----------
   Mobile: 5 side-by-side columns (the classic bingo-card look), each
   with a sticky letter label on top. Desktop reflows this into 5
   horizontal rows instead — see the >=1024px breakpoint below. */
.draw-board {
  display: flex;
  flex-direction: row;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.board-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.board-row__label {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: center;
  font-weight: 800;
  color: var(--color-accent);
  font-size: 13px;
  padding-bottom: 4px;
  background: var(--color-surface);
}
.board-row__nums { display: flex; flex-direction: column; gap: 6px; }
.board-num {
  height: var(--board-cell-size, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  font-size: var(--board-font-size, 14px);
  font-weight: var(--board-font-weight, 500);
  color: var(--color-text-dim);
  cursor: pointer;
  user-select: none;
}
.board-num:active { transform: scale(.92); }
.board-num.is-drawn {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 700;
  cursor: default;
}

/* On mobile the aside (winners/near-miss) simply sits above the rest of
   the Sorteio content, in document order. On desktop it moves to a
   sticky right column via `order`, without touching the DOM. */
.sorteio-grid { display: flex; flex-direction: column; gap: 16px; }
.sorteio-aside { display: flex; flex-direction: column; gap: 16px; }
.sorteio-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.cards-summary { display: flex; flex-direction: column; gap: 8px; }
.card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
}
.card-item__name { font-weight: 700; }
.card-item__meta { font-size: 12px; color: var(--color-text-dim); }
.card-item.is-winner { border-color: var(--color-success); box-shadow: 0 0 0 1px var(--color-success) inset; }
.card-item.is-used { opacity: .55; }
.card-item--expired { opacity: .6; border-style: dashed; }
.card-item--expired .card-item__name { text-decoration: line-through; }
.card-item__delete {
  background: none;
  border: none;
  font-size: 16px;
  padding: 6px;
  cursor: pointer;
  opacity: .7;
  flex-shrink: 0;
}
.card-item__delete:hover, .card-item__delete:focus-visible { opacity: 1; }
.card-item__actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.card-item__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-item__check { display: flex; align-items: center; flex-shrink: 0; }
.card-item__check input { width: 18px; height: 18px; accent-color: var(--color-primary); }

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

/* ---------- Prize registry chips ---------- */
.prize-list { display: flex; flex-wrap: wrap; gap: 8px; }
.prize-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  font-size: 13px;
}
.prize-chip.is-active { background: var(--color-primary); border-color: var(--color-primary); }
.prize-chip__select { background: none; border: none; color: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
.prize-chip__remove { background: none; border: none; color: inherit; opacity: .7; cursor: pointer; font-size: 12px; padding: 6px 10px 6px 6px; }
.prize-chip__remove:hover, .prize-chip__remove:focus-visible { opacity: 1; }

/* ---------- List toolbar (select-all + bulk actions) and pagination ---------- */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.list-toolbar .field--check { flex-direction: row; }
.list-toolbar__bulk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-dim); }
.list-toolbar__bulk[hidden] { display: none; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pagination[hidden] { display: none; }
.pagination__info { font-size: 12px; color: var(--color-text-dim); text-align: center; flex: 1; }

/* ---------- Dashboard ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-tile {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-tile__value { font-size: 22px; font-weight: 800; }
.stat-tile__label { font-size: 11px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: .03em; }

.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bar-row__label { width: 56px; flex-shrink: 0; color: var(--color-text-dim); text-align: right; }
.bar-row__track { flex: 1; height: 10px; background: var(--color-surface-2); border-radius: 6px; overflow: hidden; }
.bar-row__fill { height: 100%; background: var(--color-primary); border-radius: 6px; }
.bar-row__value { width: 26px; text-align: right; font-weight: 700; flex-shrink: 0; }

.history-card .card__header { align-items: flex-start; flex-wrap: wrap; gap: 4px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--color-text-dim); }
.field input[type="text"], .field input[type="number"], .field select {
  width: 100%;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
}
.field--check { flex-direction: row; align-items: center; gap: 10px; }
.field--check input { width: 20px; height: 20px; accent-color: var(--color-primary); flex-shrink: 0; }
.field--check span { color: var(--color-text); font-size: 15px; }
.field input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.field output { font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }

.desktop-only-field { display: none; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.hint { color: var(--color-text-dim); font-size: 13px; }
.save-hint { color: var(--color-success); text-align: center; font-size: 13px; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 8px 6px calc(8px + var(--safe-bottom));
  z-index: 30;
}
.bottom-nav__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  gap: 6px;
}
.bottom-nav__item {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  padding: 6px 0;
  border-radius: 10px;
  cursor: pointer;
}
.bottom-nav__icon { font-size: 20px; }
.bottom-nav__item.is-active { color: var(--color-text); background: var(--color-surface-2); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.modal[hidden] { display: none; }
.modal--winner { align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal__sheet {
  position: relative;
  background: var(--color-surface);
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal__sheet--center {
  max-width: 360px;
  margin: 0 16px;
  border-radius: 20px;
  align-items: center;
  text-align: center;
}
.modal__header { display: flex; align-items: center; justify-content: space-between; }
.modal__close { background: none; border: none; color: var(--color-text); font-size: 18px; cursor: pointer; }
.modal__body { display: flex; flex-direction: column; gap: 12px; }

.camera-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.camera-box video { width: 100%; height: 100%; object-fit: cover; }
.camera-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, rgba(255,255,255,.55) 0 2px, transparent 2px 20%),
    repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 2px, transparent 2px 20%);
  border: 2px solid rgba(255,255,255,.55);
}
/* The captured photo keeps its own aspect ratio (it may be portrait
   after rotation), so it isn't force-cropped like the live 4:3 feed. */
.captured-box { aspect-ratio: auto; display: flex; }
.captured-box[hidden] { display: none; }
.captured-box img { width: 100%; height: auto; display: block; margin: auto; }
.ocr-status { font-size: 13px; color: var(--color-text-dim); text-align: center; min-height: 18px; }

/* Four independently-draggable corner handles let the operator mark the
   number grid's real corners — even when the photo was taken at an
   angle and the grid looks like a trapezoid, not a rectangle. The app
   perspective-corrects that quad before slicing it into 5x5, so a
   plain axis-aligned box (which assumes evenly-spaced cells) isn't
   enough once there's any camera tilt. */
.quad-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.quad-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid #fff;
  touch-action: none;
  cursor: grab;
}

.letters-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  text-align: center;
  font-weight: 800;
  color: var(--color-accent);
}
.letters-row small { display: block; font-weight: 600; font-size: 10px; color: var(--color-text-dim); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.card-grid input {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  padding: 0;
}
.card-grid input.is-invalid {
  border-color: var(--color-danger);
  border-width: 2px;
  background: rgba(239, 68, 68, .18);
}
.card-grid .free-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--color-accent);
  color: #3a2504;
  font-size: 11px;
  font-weight: 800;
}

.winner-emoji { font-size: 56px; }
.winner-name { font-size: 20px; font-weight: 800; }
.winner-reason { color: var(--color-text-dim); }

.toast {
  position: fixed;
  bottom: calc(88px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  :root { --content-width: 760px; }
  body { background: var(--color-bg); }
  .app-main { padding: 24px; }
  .app-header { padding: 14px 24px; }
  .bottom-nav { padding: 10px 24px calc(10px + var(--safe-bottom)); }
  .bottom-nav__inner { gap: 14px; }
  .bottom-nav__item { flex: 0 0 auto; min-width: 96px; }
  .draw-ball { width: 180px; height: 180px; }
  .draw-board { max-height: 380px; }
  .modal__sheet:not(.modal__sheet--center) {
    /* Only positions the sheet as a whole within the outer .modal —
       must NOT set align-items/justify-content here too, since the
       sheet is itself a flex column for its own children (header,
       body); centering those vertically pushes tall content (like the
       scan modal, header included) above the visible viewport once it
       exceeds max-height, hiding the close button entirely. */
    margin: auto;
    max-width: 480px;
    border-radius: 20px;
    align-self: center;
  }
  .modal:not(.modal--winner) { align-items: center; justify-content: center; }
}

@media (min-width: 1024px) {
  :root { --content-width: 1040px; }
  .desktop-only-field { display: flex; flex-direction: column; gap: 12px; }

  /* Wide screens have plenty of horizontal room, so each letter
     becomes its own row (label + numbers running left to right)
     instead of a tall, scrolling column — easier to scan at a glance
     when projecting or running the draw from a computer. */
  .draw-board { flex-direction: column; max-height: none; overflow-y: visible; gap: 10px; }
  .board-row { flex-direction: row; align-items: center; gap: 10px; flex: none; }
  .board-row__label {
    position: static;
    width: 44px;
    flex-shrink: 0;
    background: none;
    padding-bottom: 0;
    font-size: 16px;
  }
  .board-row__nums { flex-direction: row; flex-wrap: wrap; flex: 1; gap: 8px; }
  .board-num { width: var(--board-cell-size, 56px); flex: 0 0 auto; }

  body { padding-bottom: 0; }
  .bottom-nav { display: none; }

  .side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 220px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width .18s ease;
  }
  .side-nav.is-collapsed { width: 72px; }
  .side-nav__toggle {
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
  }
  .side-nav__brand { display: flex; align-items: center; gap: 8px; padding: 8px; margin-bottom: 8px; }
  .side-nav__logo { font-size: 22px; }
  .side-nav__title { font-weight: 800; font-size: 16px; }
  .side-nav.is-collapsed .side-nav__brand { justify-content: center; }
  .side-nav.is-collapsed .side-nav__title,
  .side-nav.is-collapsed .side-nav__label { display: none; }
  .side-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: var(--color-text-dim);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
  }
  .side-nav.is-collapsed .side-nav__item { justify-content: center; padding: 10px; }
  .side-nav__icon { font-size: 18px; }
  .side-nav__item.is-active { background: var(--color-surface-2); color: var(--color-text); }

  .sorteio-grid { flex-direction: row; align-items: flex-start; gap: 20px; }
  .sorteio-main { flex: 1; order: 1; }
  .sorteio-aside { width: 300px; flex-shrink: 0; order: 2; position: sticky; top: 16px; }
}

/* ---------- Print (2/4/6 cartelas por página A4) ----------
   #printArea stays empty/hidden during normal use; printCards() fills
   it right before window.print(), and only it is visible in print
   media — the rest of the app (nav, modals, everything) is hidden so
   the printed sheet shows nothing but the cards themselves. */
#printArea { display: none; }

@media print {
  html, body { background: #fff !important; color: #000 !important; padding: 0 !important; margin: 0 !important; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; margin: 0; padding: 0; }

  @page { size: A4; margin: 10mm; }

  .print-page {
    width: 100%;
    /* Slightly under the full 277mm printable height (297mm page minus
       the 10mm top/bottom @page margins) so rounding/border thickness
       never pushes the grid a hair past one page, which would otherwise
       silently print a trailing blank page. */
    height: 270mm;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6mm;
    page-break-after: always;
    overflow: hidden;
  }
  .print-page:last-child { page-break-after: auto; }
  .print-page--2 { grid-template-rows: repeat(1, 1fr); }
  .print-page--4 { grid-template-rows: repeat(2, 1fr); }
  .print-page--6 { grid-template-rows: repeat(3, 1fr); }

  .print-card {
    border: 0.75pt solid #000;
    border-radius: 3mm;
    padding: 3mm;
    display: flex;
    flex-direction: column;
    gap: 2mm;
    break-inside: avoid;
    background: #fff;
    color: #000;
  }
  .print-card__header {
    font-size: 11pt;
    font-weight: 700;
    text-align: center;
  }
  .print-card__letters {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    font-weight: 800;
    font-size: 12pt;
  }
  .print-card__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0.5mm;
    flex: 1;
  }
  .print-card__cell {
    border: 0.5pt solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11pt;
    font-weight: 700;
  }
  .print-card__cell--free { font-size: 7pt; font-weight: 700; }
}
