:root {
  --ink: #1a1a1a;
  --line: #333;
  --muted: #555;
  --accent: #0a3d6b;
  --svod: #e8f4fc;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ppt-blue: #1a5a96;
  --photo-ar: 2185144 / 1330060;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #e5e5e5;
  line-height: 1.35;
}
.sheet {
  max-width: 820px;
  margin: 12px auto;
  background: #fff;
  border: 1px solid #999;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  padding: 16px 18px 24px;
}
@media print {
  body { background: #fff; }
  .sheet { border: none; box-shadow: none; margin: 0; max-width: none; }
  .no-print { display: none !important; }
}
.bil { display: block; font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.bil.ru { font-size: 11px; color: var(--ink); text-transform: none; font-weight: 700; }
.title-block { text-align: center; border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.title-block h1 { font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.title-block .en { font-size: 13px; font-weight: 700; margin-top: 2px; }
.org-line { text-align: center; font-size: 9px; color: var(--muted); margin-top: 8px; }
.row-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.row-table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.row-table .lbl { width: 42%; background: #f7f7f7; font-size: 11px; }
.row-table input, .row-table textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  padding: 2px 0;
  min-height: 22px;
}
.row-table input:focus, .row-table textarea:focus { outline: 1px solid var(--accent); background: #fff; }
.row-table input.from-svod { background: var(--svod); }
.product-block { border: 2px solid var(--line); margin-bottom: 16px; page-break-inside: avoid; }
.product-block h3 {
  background: #f0f0f0;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}
.product-inner { padding: 8px; }
.gost-note {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
  border: 1px dashed #aaa;
  margin-bottom: 10px;
}
.toolbar {
  max-width: 820px;
  margin: 8px auto;
  padding: 0 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar a, .toolbar button {
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid #888;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
}
.toolbar .primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.err { color: #b91c1c; font-size: 12px; }

/* Слоты фото как в 261016-6.pptx: 2185144×1330060 EMU */
.inspection-photo-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 17%) 1fr minmax(4.5rem, 17%) 1fr;
  border: 2px solid var(--ppt-blue);
  margin-bottom: 12px;
  page-break-inside: avoid;
}
.photo-caption {
  background: var(--ppt-blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  line-height: 1.25;
  border-right: 1px solid #fff;
}
.photo-caption .en { text-decoration: underline; font-size: 8px; font-weight: 700; }
.photo-caption .ru { font-size: 8px; font-weight: 600; margin-top: 2px; }
.photo-slot {
  position: relative;
  aspect-ratio: var(--photo-ar);
  min-height: 0;
  overflow: hidden;
  background: #ececec;
  border-right: 1px solid var(--ppt-blue);
}
.inspection-photo-row .photo-slot:last-child { border-right: none; }
.photo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.photo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.photo-slot .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
  text-align: center;
  padding: 8px;
  pointer-events: none;
}
.photo-slot.has-image .placeholder { display: none; }
.photo-slot .clear-photo {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid #888;
  background: rgba(255,255,255,.92);
  border-radius: 4px;
  cursor: pointer;
}
@media print {
  .photo-slot input[type="file"],
  .photo-slot .clear-photo { display: none !important; }
  .photo-slot .placeholder { display: none !important; }
}
