/* Единый генератор документов: крупная типографика, понятные шаги и карточки. */
.dg-root{
  width:100%;
  max-width:1440px;
  margin:0 auto;
  color:#182230;
  font:400 17px/1.56 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}
.dg-root *{box-sizing:border-box}
.dg-root h2,.dg-root h3{color:#102b5b;line-height:1.3}
.dg-root h2{margin:0;font-size:24px;font-weight:700}
.dg-root h3{margin:0;font-size:19px;font-weight:700}
.dg-root p{max-width:78ch}
.dg-root .muted,.dg-muted,.dg-help,.dg-meta{color:#526071;font-size:16px;line-height:1.58}
.dg-root button,.dg-root input,.dg-root select,.dg-root textarea,.dg-root a.dg-button{
  min-height:44px;
  font:inherit;
}
.dg-root input,.dg-root select,.dg-root textarea{
  width:100%;
  border:1px solid #b8c2d0;
  border-radius:10px;
  background:#fff;
  color:#182230;
  font-size:16px;
}
.dg-root input,.dg-root select{height:46px;padding:9px 12px}
.dg-root textarea{min-height:96px;padding:10px 12px;resize:vertical}
.dg-root label{display:block;margin-bottom:7px;color:#344054;font-size:16px;font-weight:650}
.dg-root input[type="checkbox"]{
  display:inline-block;
  width:22px;
  height:22px;
  min-height:22px;
  margin:0 7px 0 0;
  padding:0;
  vertical-align:middle;
  accent-color:#173b75;
}
.dg-root button:focus-visible,.dg-root a:focus-visible,.dg-root input:focus-visible,
.dg-root select:focus-visible,.dg-root textarea:focus-visible,.dg-root summary:focus-visible{
  outline:3px solid rgba(46,91,186,.3);
  outline-offset:2px;
}
.dg-tabs{
  display:flex;
  gap:8px;
  margin:0 0 22px;
  padding:4px;
  overflow-x:auto;
  border-bottom:1px solid #d9e0e9;
  scrollbar-width:thin;
}
.dg-tab{
  flex:0 0 auto;
  min-height:46px!important;
  padding:10px 16px;
  border:1px solid transparent;
  border-radius:10px 10px 0 0;
  background:transparent;
  color:#475467;
  font-size:16px!important;
  font-weight:700!important;
  cursor:pointer;
}
.dg-tab:hover{background:#f1f5fa;color:#173b75}
.dg-tab[aria-selected="true"],.dg-tab.active{border-color:#173b75;background:#102b5b;color:#fff}
.dg-tab[disabled]{cursor:not-allowed;opacity:.55}
.dg-panel{min-width:0}
.dg-stepper,.dg-steps{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 0 22px;
  padding:0;
  list-style:none;
}
.dg-step{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:10px 12px;
  border:1px solid #d9e0e9;
  border-radius:12px;
  background:#fff;
  color:#526071;
  font-size:16px;
  font-weight:650;
}
.dg-step-number,.dg-step-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  width:32px;
  height:32px;
  border-radius:50%;
  background:#e9eef5;
  color:#344054;
  font-size:16px;
  font-weight:800;
}
.dg-step.active,.dg-step[aria-current="step"]{border-color:#173b75;background:#f1f5fa;color:#102b5b}
.dg-step.active .dg-step-number,.dg-step[aria-current="step"] .dg-step-number,
.dg-step.active .dg-step-num,.dg-step[aria-current="step"] .dg-step-num{background:#102b5b;color:#fff}
.dg-step.done{border-color:#98c8af;background:#f0faf4;color:#14532d}
.dg-workspace,.dg-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(280px,360px);
  gap:20px;
  align-items:start;
}
.dg-main{min-width:0}
.dg-summary,.dg-aside{position:sticky;top:18px}
.dg-card,.dg-section,.dg-summary,.dg-aside,.dg-empty,.dg-error-state{
  border:1px solid #d9e0e9;
  border-radius:14px;
  background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04);
}
.dg-card,.dg-section,.dg-summary,.dg-aside{padding:18px}
.dg-section+.dg-section,.dg-card+.dg-card{margin-top:14px}
.dg-section-head,.dg-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.dg-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  margin-top:18px;
}
.dg-actions>button,.dg-actions>a,.dg-root .dg-button{min-height:44px!important;padding:10px 15px!important;font-size:16px!important}
.dg-fields,.dg-filter-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.dg-field{min-width:0}
.dg-source-list,.dg-card-grid,.dg-template-grid,.dg-batch-grid,.dg-variable-grid,.dg-rule-grid,.dg-participant-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.dg-source-card{
  width:100%;
  min-height:116px!important;
  padding:16px;
  border:1px solid #cfd7e3;
  border-radius:12px;
  background:#fff;
  color:#182230;
  text-align:left;
  cursor:pointer;
}
.dg-source-card:hover{border-color:#7388a6;background:#f8fafc}
.dg-source-card[aria-pressed="true"],.dg-source-card.selected{border-color:#173b75;background:#eef3fa;box-shadow:inset 0 0 0 1px #173b75}
.dg-source-card strong,.dg-card-title{display:block;color:#102b5b;font-size:17px;font-weight:700;line-height:1.4}
.dg-source-card span{display:block;margin-top:5px;color:#526071;font-size:16px;line-height:1.55}
.dg-status,.dg-badge{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:4px 9px;
  border-radius:8px;
  background:#eef1f5;
  color:#475467;
  font-size:16px;
  font-weight:700;
  line-height:1.4;
}
.dg-status.active,.dg-status.issued,.dg-badge.ok{background:#eaf8ef;color:#146c43}
.dg-status.ready{background:#eef3fa;color:#294b7a}
.dg-status.draft,.dg-status.pending,.dg-status.review_required,.dg-badge.warn{background:#fff4df;color:#8a4b0f}
.dg-status.cancelled,.dg-status.archived,.dg-badge.error{background:#feeceb;color:#a92318}
.dg-notice,.dg-alert,.dg-success,.dg-warning,.dg-blocker{
  margin:12px 0;
  padding:14px 16px;
  border:1px solid #cbd8eb;
  border-radius:11px;
  background:#f4f7fb;
  color:#344054;
  font-size:16px;
  line-height:1.58;
}
.dg-success{border-color:#a7d5bb;background:#effaf3;color:#14532d}
.dg-warning{border-color:#efd39c;background:#fff9ec;color:#7a4511}
.dg-alert,.dg-blocker{border-color:#efb7b2;background:#fff4f3;color:#912018}
.dg-checklist{display:grid;gap:10px;margin:14px 0;padding:0;list-style:none}
.dg-check{
  display:grid;
  grid-template-columns:28px minmax(0,1fr) auto;
  gap:11px;
  align-items:start;
  padding:13px 14px;
  border:1px solid #d9e0e9;
  border-radius:11px;
  background:#fff;
}
.dg-check-icon{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;background:#eef1f5;font-size:16px;font-weight:800}
.dg-check b{display:block;color:#182230;font-size:16px;line-height:1.45}
.dg-check p{margin:3px 0 0;color:#526071;font-size:16px;line-height:1.55}
.dg-pills{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px}
.dg-pill{display:inline-flex;align-items:center;min-height:34px;padding:5px 9px;border-radius:8px;background:#eef3fa;color:#294b7a;font:650 16px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
.dg-kv{display:grid;grid-template-columns:minmax(130px,36%) minmax(0,1fr);gap:0;margin:12px 0 0}
.dg-kv dt,.dg-kv dd{margin:0;padding:9px 0;border-bottom:1px solid #edf0f4;font-size:16px;line-height:1.55}
.dg-kv dt{padding-right:14px;color:#667085}.dg-kv dd{color:#182230;font-weight:600;overflow-wrap:anywhere}
.dg-table-wrap{max-width:100%;overflow-x:auto;border:1px solid #d9e0e9;border-radius:12px;background:#fff}
.dg-table{width:100%;border-collapse:collapse}
.dg-table th,.dg-table td{padding:13px 14px;border-bottom:1px solid #e7ebf0;text-align:left;vertical-align:top;font-size:16px;line-height:1.55}
.dg-table th{background:#f7f9fc;color:#475467;font-size:16px;font-weight:700}
.dg-table tr:last-child td{border-bottom:0}
.dg-empty,.dg-error-state{padding:34px 22px;text-align:center;color:#526071}
.dg-empty strong,.dg-error-state strong{display:block;margin-bottom:7px;color:#182230;font-size:18px}
.dg-loading{display:flex;align-items:center;gap:10px;min-height:80px;color:#526071;font-size:16px}
.dg-loading::before{content:"";width:20px;height:20px;border:3px solid #d9e0e9;border-top-color:#173b75;border-radius:50%;animation:dg-spin .8s linear infinite}
@keyframes dg-spin{to{transform:rotate(360deg)}}
.dg-template-meta,.dg-batch-meta{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:9px;color:#526071;font-size:16px;line-height:1.55}
.dg-version-history{margin-top:18px;padding-top:18px;border-top:1px solid #d9e0e9}
.dg-version-history>.dg-loading{min-height:64px}
.dg-version-history>.dg-error-state,.dg-version-history>.dg-empty{margin-top:12px;padding:22px 18px}
.dg-file-input{position:absolute;width:1px!important;height:1px!important;min-height:1px!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.dg-file-label{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 15px;border:1px solid #c4cfdd;border-radius:9px;background:#fff;color:#263b5d;font-size:16px;font-weight:650;cursor:pointer}
.dg-file-label:hover{border-color:#173b75;background:#eef3fa}
.dg-file-input:focus-visible+.dg-file-label{outline:3px solid rgba(46,91,186,.3);outline-offset:2px;border-color:#173b75;background:#eef3fa}
.dg-file-input:disabled+.dg-file-label{cursor:not-allowed;opacity:.6}
.dg-rule-form{margin-top:14px;padding:14px;border-radius:11px;background:#f7f9fc}
.dg-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;overflow-wrap:anywhere}
.dg-sr-status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.dg-help-panel{margin:0 0 20px;padding:18px;border:1px solid #9eb5d7;border-radius:14px;background:#f5f8fd;color:#263b5d}
.dg-help-panel ol{margin:10px 0 0;padding-left:24px}
.dg-help-panel li{margin:7px 0;font-size:16px;line-height:1.58}
.dg-legal-notice{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin:0 0 18px;
  padding:18px;
  border:1px solid #d6b66f;
  border-left:5px solid #a86c16;
  border-radius:12px;
  background:#fff9ec;
  color:#603a0c;
}
.dg-legal-notice strong{display:block;font-size:18px;line-height:1.4}
.dg-legal-notice p{margin:6px 0 0;font-size:16px;line-height:1.58}
.dg-inline-edit{margin-top:14px}
.dg-inline-edit>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:center}
.dg-checksum{overflow-wrap:anywhere;word-break:break-word}
.dg-rule-fields{grid-template-columns:repeat(3,minmax(0,1fr))}

@media(max-width:1050px){
  .dg-workspace,.dg-layout{grid-template-columns:1fr}
  .dg-summary,.dg-aside{position:static}
  .dg-rule-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:780px){
  .dg-root{font-size:17px;line-height:1.58}
  .dg-stepper,.dg-steps{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dg-source-list,.dg-card-grid,.dg-template-grid,.dg-batch-grid,.dg-variable-grid,.dg-rule-grid,.dg-participant-grid{grid-template-columns:1fr}
  .dg-fields,.dg-filter-row{grid-template-columns:1fr}
  .dg-rule-fields{grid-template-columns:1fr}
  .dg-table-wrap{overflow:visible;border:0;background:transparent}
  .dg-table,.dg-table tbody{display:block}
  .dg-table thead{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
  .dg-table tr{display:block;margin-bottom:12px;padding:6px 14px;border:1px solid #d9e0e9;border-radius:12px;background:#fff}
  .dg-table td{display:grid;grid-template-columns:minmax(112px,38%) minmax(0,1fr);gap:10px;padding:10px 0;border-bottom:1px solid #e7ebf0;font-size:16px}
  .dg-table td::before{content:attr(data-label);color:#667085;font-size:16px;font-weight:650}
  .dg-table td:last-child{border-bottom:0}
}
@media(max-width:520px){
  .dg-tabs{display:grid;grid-template-columns:1fr 1fr;overflow:visible}
  .dg-tab{width:100%;border-radius:9px}
  .dg-stepper,.dg-steps{grid-template-columns:1fr}
  .dg-step{min-height:50px}
  .dg-card,.dg-section,.dg-summary,.dg-aside{padding:15px}
  .dg-section-head,.dg-card-head{display:block}
  .dg-section-head .dg-actions,.dg-card-head .dg-actions{margin-top:11px}
  .dg-actions{align-items:stretch;flex-direction:column}
  .dg-actions>button,.dg-actions>a,.dg-root .dg-button{width:100%}
  .dg-kv{grid-template-columns:1fr}
  .dg-kv dt{padding-bottom:2px;border-bottom:0}
  .dg-kv dd{padding-top:2px}
  .dg-check{grid-template-columns:28px minmax(0,1fr)}
  .dg-check>.dg-button,.dg-check>button{grid-column:1/-1;width:100%}
  .dg-table td{grid-template-columns:1fr;gap:3px}
  .dg-legal-notice{display:block}
  .dg-legal-notice .dg-button{margin-top:14px}
  .dg-inline-edit>div{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.dg-loading::before{animation:none}}
