.select2-container--default .select2-selection--multiple {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da !important;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff !important;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

/* Renderovaná část s tagy */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

/* Tagy */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  color: #212529;
  margin: 0 0 0.3rem 0;
  border-radius: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Text uvnitř tagu */
.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  padding: 0.4rem 0.4rem 0.4rem 1.3rem;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
}

/* Křížek */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  font-size: 1.2rem;
  padding: 0 0.5rem 0.3rem 0.5rem;
  cursor: pointer;
  border-right: 1px solid #ced4da;
}


.select2-container--default .select2-selection--multiple .select2-search__field {
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: none;
  outline: none;
  caret-color: #495057;
  font-family: inherit;
  cursor: text;
}

@media print {
  /* Base print font: bigger + black */
  body,
  .container,
  .card,
  .card-body,
  .form-group,
  .input-group-text,
  label,
  input,
  select,
  textarea,
  p,
  span,
  small,
  a,
  h1, h2, h3, h4, h5, h6 {
    color: #000 !important;
  }

  p.text-muted { color: #000 !important; }

  .d-print-hint { font-size: 16px !important; }

  a {
    text-decoration: none !important;
  }

  /* Structural elements: visible black borders */
  .card,
  .card-body,
  .card-header,
  .alert{
    border: 1px solid #2e2e2e !important;
  }

  /* Hide real selects */
  select.form-select { display: none !important; }

  /* Show the helper hint */
  .d-print-hint { display: inline !important; }

  /* Modern browsers with :has() */
  .form-group:has(> select.form-select) { position: relative; }
  .form-group:has(> select.form-select) > select.form-select {
    visibility: hidden;
  }
  .form-group:has(> select.form-select)::after {
    content: "";
    display: block;
    height: calc(1.5em + .75rem + 2px);
    margin-top: .25rem;
    border: 1px solid #000 !important;
    border-radius: 0.25rem;
    background-color: #fff !important;
  }

  /* Date inputs replaced with visible boxes */
  .form-group:has(> input[type="date"]) { position: relative; }
  .form-group:has(> input[type="date"]) > input[type="date"] {
    display: none !important;
  }
  .form-group:has(> input[type="date"])::after {
    content: "";
    display: block;
    height: calc(1.5em + .75rem + 2px);
    /*margin-top: .25rem;*/
    border: 1px solid #000 !important;
    border-radius: 0.25rem;
    background-color: #fff !important;
  }

  input::placeholder,
  textarea::placeholder {
    color: transparent !important;
  }

  /* Pro jistotu i starší WebKit */
  input::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder {
    color: transparent !important;
  }
  input::-moz-placeholder,
  textarea::-moz-placeholder {
    color: transparent !important;
  }
  input:-ms-input-placeholder,
  textarea:-ms-input-placeholder {
    color: transparent !important;
  }
  input::-ms-input-placeholder,
  textarea::-ms-input-placeholder {
    color: transparent !important;
  }

  /* Hide select2 widgets on print */
  .select2, .select2-container { display: none !important; }

  /* Inputs, textareas, selects: stronger visible borders */
  input.form-control,
  textarea.form-control,
  select.form-select {
    border: 1px solid #000 !important;
    border-radius: 0.25rem !important;
    background-color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Radio buttons and checkboxes */
  input[type="radio"],
  input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    border: 1px solid #000 !important;
    accent-color: #000 !important;
  }

  .input-group-text {
    border: 1px solid #000 !important;
  }

  /* Allow sections to split across pages */
  .card,
  .card-body {
    break-inside: auto;
    page-break-inside: auto;
  }

  .card-header { break-after: avoid; }

  .form-row {
    display: block !important;
    break-inside: auto;
    page-break-inside: auto;
  }

  .form-group {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .keep-with-next { break-after: avoid; }

  .form-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;               /* optional: keep Bootstrap spacing only */
  }



  /* Make sure each .form-group fills its column */
  .form-row > [class*="col-"] > .form-group {
    width: 100% !important;
  }

  .form-group.print-inline{
    flex: 0 0 100% !important; max-width: 100% !important;
  }

  .print-only {
    display: inline !important;
  }

  .print-padding-top {
    padding-top: 1.25rem !important;
  }

  .print-padding-bottom {
    padding-bottom: 1.25rem !important;
  }

  .print-mt {
    margin-top: 0.5rem !important;
  }

  .print-mb {
    margin-bottom: 0.5rem !important;
  }

  /* Common Bootstrap cols you use — set print widths */
  .col-11, .col-md-11 { flex: 0 0 91.6667% !important; max-width: 91.6667% !important; }
  .col-10, .col-md-10 { flex: 0 0 83.3333% !important; max-width: 83.3333% !important; }
  .col-9,  .col-md-9  { flex: 0 0 75% !important;      max-width: 75% !important; }
  .col-8,  .col-md-8  { flex: 0 0 66.6667% !important; max-width: 66.6667% !important; }
  .col-7,  .col-md-7  { flex: 0 0 58.3333% !important; max-width: 58.3333% !important; }
  .col-6,  .col-md-6  { flex: 0 0 50% !important;      max-width: 50% !important; }
  .col-5,  .col-md-5  { flex: 0 0 41.6667% !important; max-width: 41.6667% !important; }
  .col-4,  .col-md-4  { flex: 0 0 33.3333% !important; max-width: 33.3333% !important; }
  .col-3,  .col-md-3  { flex: 0 0 25% !important;      max-width: 25% !important; }
  .col-2,  .col-md-2  { flex: 0 0 16.6667% !important; max-width: 16.6667% !important; }
  .col-1,  .col-md-1  { flex: 0 0 8.3333% !important;  max-width: 8.3333% !important; }

  .col-12, .col-md-12 { flex: 0 0 100% !important; max-width: 100% !important; }
  .print-col-md-12 { flex: 0 0 100% !important; max-width: 100% !important; }
  .print-col-md-6  { flex: 0 0 50% !important; max-width: 50% !important; }




  .notar-help {
    color: black !important;
    margin-top: 4mm !important;
    margin-bottom: 4mm !important;
  }

  .notar-help .container-fluid {
    max-width: 175mm !important;      /* was 140mm; feel free to push to 180mm */
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
  }

  .notar-help.alert {
    padding: 4mm !important;          /* was 8mm */
    background: #fff !important;
    border: 1px solid #000 !important;
  }

  .notar-help .row {
    margin-bottom: 1.5mm !important;
  }

  .notar-help .col-md-5 {
    flex: 0 0 45% !important;
    max-width: 45% !important;
    text-align: right !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
  }
  .notar-help .col-md-7 {
    flex: 0 0 55% !important;
    max-width: 55% !important;
  }

  .notar-help a[href]::after { content: "" !important; }


  .print-no-mb {
    margin-bottom: 0 !important;
  }

  .print-no-mt {
    margin-top: 0 !important;
  }

  .print-no-pt {
    padding-top: 0 !important;
  }

  .d-print-none { display: none !important; }

}

.print-only {
  display: none;
}

/* Screen-only */
.d-print-hint { display: none; }


@media print {
  .form-check-input,
  input[type="checkbox"],
  input[type="radio"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background: #fff !important;
    background-image: none !important;    /* kills Bootstrap's SVG check */
    border: 1px solid #000 !important;
    box-shadow: none !important;
    width: 1.2em !important;
    height: 1.2em !important;
    margin-top: .2em;                     /* tweak as needed */
  }
  input[type="checkbox"] { border-radius: .2em !important; }
  input[type="radio"]    { border-radius: 50% !important; }

  /* Even if they are checked, keep them empty */
  .form-check-input:checked,
  input[type="checkbox"]:checked,
  input[type="radio"]:checked {
    background: #fff !important;
    background-image: none !important;
  }

  /* kill dark backgrounds in footer */
  footer.bg-dark,
  footer .bg-dark { background: transparent !important; }

  /* force solid black text & links */
  footer,
  footer *,
  footer a,
  footer a:link,
  footer a:visited,
  footer p,
  footer span,
  footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important; /* WebKit print quirk */
  }

  /* remove transparency utilities */
  footer .opacity-75 { opacity: 1 !important; }

  /* neutralize Bootstrap link color helpers */
  footer .link-light,
  footer .text-white { color: #000 !important; }

  /* remove underline in print */
  footer a { text-decoration: none !important; }

  /* overkill specificity so it outranks .text-decoration-underline!important */
  html body footer a.text-decoration-underline,
  body footer a.text-decoration-underline,
  footer.bg-dark a.text-decoration-underline,
  footer a.text-decoration-underline {
    text-decoration: none !important;
  }

  /* also nuke underlines on any footer links, just in case */
  html body footer a[href] {
    text-decoration: none !important;
  }

  /* some browsers append URLs on print */
  html body footer a[href]::after { content: "" !important; }
}

.mb-tiny {
  margin-bottom: 2px !important;
}
