:root { color-scheme: light; font: 16px/1.55 system-ui, sans-serif; color: #102a32; background: #eef4f3; }
body { margin: 0; }
main { max-width: 52rem; margin: auto; padding: clamp(1rem, 5vw, 3rem); overflow-wrap: anywhere; }
header { border-bottom: 2px solid #198374; margin-bottom: 1.5rem; }
h1 { margin: 0; font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: -.04em; }
form, article { background: white; padding: clamp(1rem, 4vw, 1.75rem); border: 1px solid #b9d2cc; border-radius: 1rem; margin-bottom: 1rem; }
label { display: block; margin-top: .8rem; font-weight: 650; }
select, textarea, input { font: inherit; max-width: 100%; box-sizing: border-box; }
textarea, select { width: 100%; padding: .55rem; border: 1px solid #6d8d87; border-radius: .4rem; }
button { font: inherit; background: #075c54; color: white; border: 0; padding: .65rem 1rem; border-radius: .5rem; cursor: pointer; }
button:disabled { background: #d5dfde; color: #394e4b; cursor: default; }
.actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
:focus-visible { outline: 3px solid #9f4400; outline-offset: 3px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: .75rem; background: #eef4f3; border-radius: .4rem; }
summary { cursor: pointer; padding-block: .4rem; font-weight: 650; }
mark { background: #ffdf8b; color: #2a210b; border-radius: .2em; }
#export { margin-bottom: 1rem; }

@media print {
  body { background: white; color: black; }
  main { max-width: unset; padding: 0; }
  main > :not(#print-output) { display: none !important; }
  #print-output { display: block !important; }
  #print-output table { border-collapse: collapse; width: 100%; font-size: 9pt; }
  #print-output th, #print-output td { border: 1px solid #aaa; padding: .25rem; text-align: left; }
  #print-output tr { break-inside: avoid; }
}

#scope-preview { margin-top: 1rem; padding: 1rem; border: 1px solid #9bb5af; border-radius: .5rem; }
#scope-preview p { overflow-wrap: anywhere; margin-block: .65rem; }

/* Визуальные конструкторы */
.bfs-rows { display: grid; gap: .75rem; margin-block: .75rem; }
.bfs-row { border: 1px solid #9bb5af; border-radius: .6rem; padding: .5rem .75rem .75rem; margin: 0; }
.bfs-row legend { font-weight: 650; padding-inline: .4rem; }
.bfs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .5rem .75rem; }
.bfs-field span { display: block; font-size: .9rem; }
.bfs-field input, .bfs-field textarea, .bfs-field select { width: 100%; padding: .5rem; border: 1px solid #6d8d87; border-radius: .4rem; }
.bfs-add { background: #e3f1ee; color: #075c54; border: 1px solid #198374; }
.bfs-remove { background: transparent; color: #8a1c1c; border: 1px solid #c58b8b; margin-top: .6rem; padding: .35rem .7rem; }
.bfs-advanced { margin-top: .8rem; }
.bfs-hint { margin-block: .25rem; color: #3b5752; }
.bfs-error { color: #8a1c1c; font-weight: 650; }
.bfs-check { display: flex; gap: .4rem; align-items: flex-start; font-weight: 500; }
.bfs-check input { margin-top: .35rem; }
[hidden] { display: none !important; }

/* Выбор файлов */
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .75rem; border: 2px dashed #6d8d87; border-radius: .6rem; background: #f7fbfa; margin-block: .35rem .75rem; }
.picker.dragging { border-color: #075c54; background: #e3f1ee; }
.picker.has-files { border-style: solid; }
.picker-native { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.picker-native:focus-visible + .picker-button { outline: 3px solid #0b6bcb; outline-offset: 2px; }
.picker-button { display: inline-block; background: #075c54; color: #fff; padding: .6rem 1rem; border-radius: .45rem; font-weight: 650; cursor: pointer; }
.picker-hint { color: #3b5752; font-size: .9rem; }
.picker-summary { flex-basis: 100%; overflow-wrap: anywhere; font-weight: 600; }
#advanced-settings { margin-block: 1rem; border-top: 1px solid #9bb5af; padding-top: .75rem; }
#advanced-settings > summary { font-weight: 700; cursor: pointer; }
