/* Robeža — worksheet builder screen + the printed A4 sheets. */

.ws-intro {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: .95rem;
}

.ws-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: flex-end;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.field { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; }

.field > span {
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.field select {
  appearance: none;
  font: inherit;
  font-size: .95rem;
  padding: 8px 32px 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center/11px;
  color: var(--ink);
  cursor: pointer;
}

.field.check { flex-direction: row; align-items: center; gap: 9px; }
.field.check span { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); font-weight: 500; }
.field.check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.ws-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ws-actions .btn { flex: 1 1 auto; }
.ws-error { color: var(--tier-low); text-align: center; padding: 40px 0; }

/* ------------------------------------------------------------ sheet preview */

.sheets { max-width: 186mm; margin: 26px auto 60px; padding: 0 16px; }

.sheet {
  /* Always paper: the sheets stay black-on-white whatever the site theme is. */
  background: #fff;
  color: #111;
  width: 100%;
  padding: 8mm 8mm 6mm;
  margin-bottom: 20px;
  border-radius: 3px;
  box-shadow: 0 4px 26px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  font-size: 10pt;
}

@media (min-width: 800px) {
  .sheet { min-height: 273mm; }
}

.sheet-head { border-bottom: 1px solid #ccc; padding-bottom: 3mm; margin-bottom: 5mm; }
.sheet-head h2 { margin: 0; font-size: 15pt; letter-spacing: .12em; text-transform: uppercase; }
.sheet-sub { margin: 2mm 0 0; font-size: 9pt; color: #444; }
.sheet-instruction { margin: 2mm 0 0; font-size: 9pt; color: #444; }

.sheet-fields { display: flex; gap: 12mm; }
.sheet-fields i { display: inline-block; width: 42mm; border-bottom: 1px solid #999; }

.grid { display: grid; gap: 7mm; flex: 1; align-content: start; }
.grid-2 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr; }

.item { margin: 0; display: flex; flex-direction: column; break-inside: avoid; page-break-inside: avoid; }
.item figcaption { font-size: 9.5pt; font-weight: 700; margin-bottom: 1.5mm; }
.item .num { color: #666; }

.map {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid #d5d5d5;
  border-radius: 2mm;
  background: #fff;
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ddd;
  margin-top: 5mm;
  padding-top: 2mm;
  font-size: 7.5pt;
  color: #777;
}

/* -------------------------------------------------------------------- print */

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

  html, body {
    background: #fff;
    color: #111;
    margin: 0;
    padding: 0;
  }

  .noprint { display: none !important; }

  .sheets { max-width: none; margin: 0; padding: 0; }

  .sheet {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .sheet:last-child { break-after: auto; page-break-after: auto; }

  /* Keep the grey landmasses; browsers strip backgrounds when printing otherwise. */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
