.plate {
  position: relative;
  z-index: 1;
  padding: clamp(1.1rem, 3vw, 2rem) clamp(0.85rem, 3vw, 1.5rem) 2.6rem;
}

.plate-print-head {
  display: none;
}

.plate-sheet {
  width: min(74rem, 100%);
  margin: 0 auto;
  padding: 1.15rem 1.1rem 1.25rem;
  border-radius: 0.85rem;
  background: #fff;
  border: 1px solid #d5e0ea;
  box-shadow: 0 18px 40px rgba(6, 22, 40, 0.18);
  color: #123047;
}

.plate-head {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid #123047;
}

.plate-head__crumb {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: #4d6780;
}

.plate-head__crumb a {
  color: #1f5f99;
  text-decoration: none;
}

.plate-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
}

.plate-head__meta {
  margin: 0;
  font-size: 0.82rem;
  color: #4d6780;
}

.plate-form {
  padding: 0.7rem 0.75rem 0.55rem;
  margin-bottom: 0.7rem;
  border: 1px solid #c5d2de;
  border-radius: 0.55rem;
  background: #f4f8fb;
}

.plate-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 4.35rem minmax(0, 1.15fr) auto;
  gap: 0.45rem 0.5rem;
  align-items: end;
}

.plate-form__row--nabshi {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(0, 1.05fr) 4.2rem minmax(0, 1fr) auto;
}

.plate-form__row--nabshi .plate-field span {
  white-space: normal;
  line-height: 1.25;
}

.plate-field__hint {
  color: #d32f2f;
  font-weight: 800;
}

.plate-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.plate-field--qty {
  width: 4.35rem;
}

.plate-field--action {
  min-width: 4.6rem;
}

.plate-field span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #123047;
  white-space: nowrap;
}

.plate-field em {
  font-style: normal;
  font-size: 0.7rem;
  color: #4d6780;
}

.plate-field input,
.plate-field output {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #b7c6d4;
  border-radius: 0.4rem;
  background: #fff;
  color: #123047;
  font: inherit;
  font-weight: 700;
}

.plate-field input:focus {
  outline: 2px solid rgba(31, 95, 153, 0.35);
  border-color: #1f5f99;
}

.plate-field--weight output {
  display: flex;
  align-items: center;
  background: #e8f1f6;
  border-color: #9dc0dc;
}

.plate-add {
  width: auto;
  min-width: 4.5rem;
  padding-inline: 0.85rem;
  white-space: nowrap;
}

.plate-add,
.plate-tool {
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: 0.4rem;
  background: #123047;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.plate-add:hover,
.plate-tool:hover:not(:disabled) {
  background: #0e2438;
}

.plate-tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.plate-tool--ghost {
  background: #fff;
  color: #123047;
  border: 1px solid #c5d2de;
}

.plate-tool--ghost:hover:not(:disabled) {
  background: #eef3f8;
}

.plate-form__hint {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: #9e4318;
}

.plate-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.plate-table-wrap {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid #123047;
  border-radius: 0.35rem;
}

.plate-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(18, 48, 71, 0.14);
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
  z-index: 3;
}

.plate-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
  position: relative;
  z-index: 1;
  background: #fff;
}

.plate-table th,
.plate-table td {
  padding: 0.62rem 0.5rem;
  border: 1px solid #7f96aa;
  text-align: center;
  font-size: 0.88rem;
}

.plate-table thead th {
  background: #123047;
  color: #fff;
  font-weight: 800;
  border-color: #2c4a63;
  border-bottom: 2px solid #0a1c2c;
}

.plate-table tbody tr:nth-child(even) td {
  background: #f4f8fb;
}

.plate-table tfoot {
  border-top: 2px solid #123047;
}

.plate-table tfoot th,
.plate-table tfoot td {
  background: #e8f1f6;
  font-weight: 800;
  border: 1px solid #7f96aa;
}

.plate-sum th {
  text-align: center;
  letter-spacing: 0.04em;
}

.plate-sum td {
  background: #e4eef5;
}

.plate-sum-kg th {
  background: #d7e6f0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1b3a4b;
}

.plate-sum-kg td {
  background: #d7e6f0;
}

.plate-sum-kg td#plate-sum-kg {
  background: #c9dce9;
  font-size: 0.95rem;
  color: #123047;
}

.plate-empty td {
  color: #4d6780;
  font-weight: 500;
  padding: 1.4rem 0.7rem;
}

.plate-related {
  margin-top: 1rem;
  padding: 0.7rem 0.75rem 0.55rem;
  border: 1px solid #c5d2de;
  border-radius: 0.45rem;
  background: #f4f8fb;
}

.plate-related__title {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #123047;
}

.plate-related__scroller {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.1rem 0.1rem 0.45rem;
  scrollbar-width: thin;
}

.plate-related__card {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid #c5d2de;
  border-radius: 0.4rem;
  background: #fff;
  text-decoration: none;
  overflow: hidden;
}

.plate-related__card:hover,
.plate-related__card:focus-visible {
  border-color: #1f5f99;
  outline: none;
}

.plate-related__card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.plate-related__placeholder {
  width: 120px;
  height: 120px;
  background:
    radial-gradient(circle at 35% 30%, #9dc0dc, transparent 55%),
    linear-gradient(160deg, #1f5f99, #123047);
}

.plate-remove {
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 50%;
  background: rgba(18, 48, 71, 0.08);
  color: #123047;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.plate-remove:hover {
  background: rgba(158, 67, 24, 0.16);
}

@media (max-width: 720px) {
  .plate-form__row,
  .plate-form__row--nabshi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .plate-field--qty,
  .plate-field--action {
    width: auto;
  }

  .plate-add {
    width: 100%;
  }

  .plate-form__row--listofer-stock,
  .plate-form__row--listofer-cut,
  .listofer-grid,
  .listofer-selected__meta {
    grid-template-columns: 1fr;
  }
}

.plate--compact {
  padding: 0.85rem 0.75rem 1.6rem;
}

.plate--compact .plate-sheet {
  padding: 0.85rem 0.8rem 1rem;
}

.plate--compact .plate-head {
  margin-bottom: 0.7rem;
  padding-bottom: 0.55rem;
}

.plate--compact .plate-head h1 {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  margin-bottom: 0.2rem;
}

.plate--compact .plate-form {
  padding: 0.5rem 0.6rem 0.4rem;
  margin-bottom: 0.55rem;
}

.plate--compact .plate-field input,
.plate--compact .plate-field output {
  min-height: 2.2rem;
  padding: 0.35rem 0.45rem;
}

.plate--compact .plate-field span {
  white-space: normal;
  line-height: 1.25;
}

.plate-form__row--listofer-stock {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1.1fr);
}

.plate-form__row--listofer-cut {
  grid-template-columns: minmax(0, 1.25fr) minmax(5.8rem, 0.85fr) minmax(0, 1.1fr) auto;
}

.plate-form__row--listofer-cut .plate-field--qty {
  width: auto;
}

.listofer-selected {
  margin: 0 0 0.7rem;
  padding: 0.55rem 0.7rem 0.5rem;
  border: 1px solid #9dc0dc;
  border-radius: 0.45rem;
  background: #e8f1f6;
}

.listofer-selected__title {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #123047;
}

.listofer-selected__meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.listofer-selected__meta div {
  min-width: 0;
}

.listofer-selected__meta dt {
  font-size: 0.7rem;
  color: #4d6780;
}

.listofer-selected__meta dd {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  font-weight: 800;
}

.listofer-results {
  margin-top: 0.85rem;
}

.listofer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.listofer-table-title {
  margin: 0;
  padding: 0.4rem 0.55rem;
  background: #123047;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.listofer-table-title--summary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
}

.listofer-table-title--summary::after {
  content: "";
}

.listofer-table-title__name {
  justify-self: start;
}

.listofer-table-title__unit {
  justify-self: center;
  padding: 0.12rem 0.55rem;
  border-radius: 0.25rem;
  background: #ffe566;
  color: #123047;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.listofer-results .plate-table-wrap {
  overflow-x: auto;
}

.listofer-results .plate-table thead th {
  font-size: 0.78rem;
  padding: 0.45rem 0.4rem;
  white-space: normal;
  line-height: 1.25;
}

.listofer-results .plate-table td,
.listofer-results .plate-table th {
  font-size: 0.8rem;
  padding: 0.42rem 0.4rem;
}

.listofer-summary thead th {
  font-size: 0.7rem;
}

.listofer-results .plate-table td.listofer-em {
  font-weight: 800;
  font-size: 1.12rem;
  color: #0b2436;
  background: #dceaf3;
}

@media (max-width: 640px) {

  .plate-toolbar {
    justify-content: stretch;
  }

  .plate-tool {
    flex: 1;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm 12mm;
  }

  body.site,
  body.site.site--blank {
    background: #fff !important;
    color: #123047;
  }

  .lab-ambient,
  .site-nav,
  .no-print,
  .plate-remove {
    display: none !important;
  }

  .site-main {
    min-height: 0;
  }

  .plate {
    padding: 0;
  }

  .plate-print-head {
    display: block;
    text-align: center;
    margin-bottom: 0.9rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #c5d2de;
  }

  .plate-print-head strong {
    display: block;
    font-size: 1.15rem;
    color: #1f5f99;
  }

  .plate-print-head span {
    display: block;
    margin-top: 0.2rem;
    color: #4d6780;
  }

  .plate-sheet {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .plate-table-wrap {
    overflow: visible;
    border: 2px solid #123047;
  }

  .plate-watermark {
    color: rgba(18, 48, 71, 0.1);
  }

  .plate-table thead {
    display: table-header-group;
  }

  .plate-table tfoot {
    display: table-footer-group;
  }

  .listofer-grid {
    grid-template-columns: 1fr;
  }

  .listofer-selected {
    display: block !important;
  }

  .listofer-results {
    display: block !important;
  }

  .listofer-table-title__unit {
    background: #ffe566 !important;
    color: #123047 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
