[hidden] { display: none !important; }
.resource-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1rem; }
fieldset { border: 0; padding: 0; }
#resource-table .button { margin: 0; }
#directory-results { height: 14rem; }
#waybill-preview, .waybill-print-card {
  display: flex;
  width: 4in;
  height: 4in;
  margin: 1rem 0;
  color: #111;
  background: white;
  outline: 1px solid #222;
  overflow-wrap: anywhere;
}
#waybill-preview:empty { display: none; }
.waybill-face { box-sizing: border-box; width: 2in; height: 4in; flex: none; }
.waybill-face + .waybill-face { border-left: 1px dashed #555; }
.waybill-cycle {
  box-sizing: border-box;
  width: 100%;
  height: 2in;
  padding: .08in;
  font: 8pt/1.15 Arial, sans-serif;
}
.waybill-cycle + .waybill-cycle { border-bottom: 1px dashed #555; transform: rotate(180deg); }
#waybill-preview h2 { font: bold 10pt/1.15 Arial, sans-serif; margin: 0 0 .05in; }
#waybill-preview p, .waybill-print-card p { font: inherit; white-space: pre-wrap; margin: 0 0 .03in; }
.cycle-editor { border: 1px solid #aaa; padding: 1rem; margin-bottom: 1rem; }
@media print {
  @page { margin: .4in; }
  .no-print { display: none !important; }
  #waybill-preview, .waybill-print-card { break-inside: avoid; }
}

#resource-table td { white-space: pre-line; }

.industry-spot { border: 1px solid #aaa; padding: 1rem; margin-bottom: 1rem; }

.waybill-list {
  max-height: 28rem;
  max-height: min(28rem, 60vh);
  overflow: auto;
}
.waybill-list table { margin-bottom: 0; }
.waybill-list thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8f8f8;
  box-shadow: 0 1px 0 #ddd;
}
.waybill-list:focus-visible { outline: 2px solid #1779ba; outline-offset: 2px; }


/* Keep batch cards measurable for overflow checks without showing them on screen. */
#waybill-batch { position: absolute; left: -10000px; top: 0; visibility: hidden; }
@media print {
  #waybill-batch { display: none; }
  body[data-waybill-print="all"] > main,
  body[data-waybill-print="all"] > nav { display: none !important; }
  body[data-waybill-print="all"] #waybill-batch {
    display: block; position: static; visibility: visible;
    page: waybill-batch;
  }
  @page waybill-batch { size: letter portrait; margin: .2in; }
  .waybill-sheet {
    display: grid;
    grid-template-columns: 4in 4in;
    grid-auto-rows: 4in;
    gap: .08in;
    width: 8.08in;
    break-inside: avoid;
    break-after: page;
  }
  .waybill-sheet:last-child { break-after: auto; }
  .waybill-print-card {
    margin: 0;
    break-after: auto;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .waybill-print-card:last-child { margin-bottom: 0; }
}

.industry-card {
  box-sizing: border-box;
  width: 4in;
  max-width: 100%;
  border: 1px solid #222;
  padding: .15in;
  color: #111;
  background: white;
  font: 10pt/1.3 Arial, sans-serif;
  overflow-wrap: anywhere;
}
.industry-card h2 { font: bold 15pt/1.2 Arial, sans-serif; margin: 0 0 .1in; }
.industry-card h3 { font: bold 12pt/1.2 Arial, sans-serif; margin: .1in 0 .04in; }
.industry-card h4 { font: bold 10pt/1.2 Arial, sans-serif; margin: .06in 0 .02in; }
.industry-card p { font: inherit; margin: 0 0 .05in; white-space: pre-wrap; }
.industry-card ul { margin: 0 0 .06in .2in; }
.industry-card-spot { border-top: 1px solid #aaa; break-inside: avoid; }
.industry-card footer { border-top: 1px solid #aaa; padding-top: .05in; font-size: 8pt; }
#industry-print { display: none; }
@media print {
  body[data-resource="industries"] > main,
  body[data-resource="industries"] > nav { display: none !important; }
  #industry-print { display: block; }
  .industry-card { max-width: none; break-inside: avoid; break-after: page; }
  .industry-card:last-child { break-after: auto; }
}

#waybill-editor {
  width: min(64rem, 94vw);
  max-height: 90vh;
  overflow: auto;
  margin: auto;
  padding: 1.25rem;
  border: 1px solid #777;
  border-radius: .25rem;
}
#waybill-editor::backdrop { background: rgb(0 0 0 / 50%); }
#resource-table td:last-child .button + .button { margin-left: .4rem; }
@media print {
  #waybill-editor { display: none !important; }
  #waybill-editor::backdrop { display: none; }
}
