.document-flow {
  container: ged-stages / inline-size;
  min-width: 0;
  margin: 0 0 22px;
  padding: 18px;
  border: 1px solid #dfe6ed;
  border-radius: 14px;
  background: #fff;
  color: #152a41;
}
.document-flow-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.document-flow-head strong { display: block; margin-top: 5px; font-size: 14px; line-height: 1.5; }
.document-flow-helper { max-width: 240px; color: #64758a; font-size: 12px; line-height: 1.6; text-align: right; }
.document-stage-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.document-stage-list li { min-width: 0; }
.document-stage-list button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: 36px auto;
  align-content: start;
  gap: 7px 9px;
  width: 100%;
  height: 100%;
  min-height: 108px;
  padding: 14px 12px;
  border: 1px solid #e0e7ee;
  border-radius: 12px;
  background: #f8fafc;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  appearance: none;
  transition: background .15s, border-color .15s;
}
.document-stage-list button:disabled { opacity: 1; cursor: default; }
.document-stage-list button:hover:not(:disabled) { border-color: #b7954d; background: #fcf9f1; }
.document-stage-list button:focus-visible, .document-kind-card:focus-visible { outline: 3px solid #daa841; outline-offset: 3px; }
.document-stage-number { display: grid; place-items: center; grid-column: 1; grid-row: 1; width: 26px; height: 26px; border-radius: 50%; background: #e9eef3; color: #566a80; font-size: 12px; font-weight: 700; }
.document-stage-copy { display: contents; }
.document-stage-copy b { display: block; grid-column: 2; grid-row: 1; min-height: 36px; font-size: 13px; line-height: 18px; font-weight: 650; }
.document-stage-copy small { display: block; grid-column: 1 / -1; grid-row: 2; min-height: 36px; color: #5e7086; font-size: 11.5px; line-height: 18px; overflow-wrap: break-word; }
.document-stage-list button > .ico { display: none; }
.document-stage-list .current button { border-color: #b68b35; background: #fcf5e6; }
.document-stage-list .current .document-stage-number { background: #a87924; color: #fff; }
.document-stage-list .done .document-stage-number { background: #e0f0ea; color: #267150; }
.document-flow.compact { padding: 16px; margin-bottom: 20px; }
.document-flow.compact .document-flow-helper { display: none; }

@container ged-stages (max-width: 600px) {
  .document-stage-list { grid-template-columns: 1fr; gap: 8px; }
  .document-stage-list button { grid-template-rows: auto auto; min-height: 64px; padding: 12px 14px; gap: 2px 10px; }
  .document-stage-number { grid-row: 1 / 3; align-self: center; }
  .document-stage-copy b { min-height: 0; }
  .document-stage-copy small { grid-column: 2; min-height: 0; }
}

.document-kind-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:22px 0}.document-kind-card{border:1px solid #dce4ee;border-radius:16px;min-width:0;background:#fff;padding:25px 21px;text-align:left;cursor:pointer;color:#172c44;display:flex;flex-direction:column;align-items:flex-start;gap:14px;font:inherit;box-shadow:0 5px 18px #17324d04}.document-kind-card:hover{border-color:#c39843;box-shadow:0 9px 25px #17324d0a;transform:translateY(-2px)}.document-kind-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:13px;background:#f5ecdb;color:#987027}.document-kind-icon .ico{width:24px;height:24px}.document-kind-card>b{font-size:19px}.document-kind-card>p{font-size:13px;line-height:1.65;color:#64758a;margin:0;flex:1}.document-kind-card>span:last-child{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;color:#8f6725;margin-top:6px}.creation-explanation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:25px;margin:35px 0}.creation-explanation>div{font-size:13px;line-height:1.7;color:#66768a}.creation-explanation .ico{display:block;color:#6f8096;margin-bottom:10px}.creation-explanation b{color:#1c3149}.creation-explanation p{margin:5px 0}.creation-wizard-steps{list-style:none;display:flex;gap:24px;padding:0;margin:0 0 25px;flex-wrap:wrap}.creation-wizard-steps li{font-size:12px;color:#8190a2;display:flex;gap:8px;align-items:center}.creation-wizard-steps span{width:24px;height:24px;border-radius:50%;background:#eef2f6;display:grid;place-items:center;font-weight:700}.creation-wizard-steps .current{color:#94671f;font-weight:700}.creation-wizard-steps .current span{background:#a87923;color:#fff}.creation-wizard-steps .done{color:#28745c}.creation-extra{border:1px solid #e1e7ee;border-radius:12px;margin:18px 0;background:#fafbfd}.creation-extra summary{padding:16px;cursor:pointer;font-size:13px;font-weight:600;color:#344b65}.creation-extra>div{padding:0 18px 16px}.creation-review{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:20px 0 25px}.creation-review>div{min-width:0}.creation-review dt{font-size:12px;color:#77879a}.creation-review dd{margin:5px 0 0;font-size:14px;font-weight:600;overflow-wrap:anywhere}.creation-text-preview{background:#fafbfd;border:1px solid #e1e7ed;padding:20px;border-radius:12px}.creation-text-preview h3{font-size:14px}.creation-text-preview>div{white-space:pre-wrap;font-size:13px;line-height:1.8;overflow-wrap:anywhere;max-height:330px;overflow-y:auto}.creation-review-actions{margin-top:18px}.stage-heading{margin:22px 0 18px}.stage-heading h3{font-size:17px;margin:12px 0 5px}.stage-heading p{font-size:13px;color:#67788d}.stage-checklist{list-style:none;padding:0;margin:18px 0;border:1px solid #e1e7ee;border-radius:12px;overflow:hidden}.stage-checklist>li{display:flex;gap:12px;align-items:center;padding:15px 16px;background:#fff}.stage-checklist>li+li{border-top:1px solid #e8edf3}.stage-checklist .ico{color:#a78b52;flex:none}.stage-checklist .ok>.ico{color:#337d60}.stage-checklist li>div{flex:1;min-width:0}.stage-checklist b{font-size:13px;font-weight:600;display:block;overflow-wrap:anywhere}.stage-checklist small{font-size:11px;display:block;margin-top:4px;color:#8a713d}.stage-checklist .ok small{color:#337d60}.stage-actions{display:flex;flex-wrap:wrap;gap:10px;margin:24px 0 18px}.quick-document-launch{display:flex;gap:10px;flex-wrap:wrap}.document-flow+.creation-wizard-steps{margin-top:24px}

.stage-prerequisite { display:flex; align-items:center; gap:18px; justify-content:space-between; background:#fbf5e8; border:1px solid #e8d9b5; border-radius:12px; padding:18px; margin:20px 0; }
.stage-prerequisite b { font-size:14px; color:#78551f; }
.stage-prerequisite p { font-size:13px; color:#8d734c; line-height:1.7; margin:7px 0 0; }
.stage-prerequisite .btn { flex:none; }

.stage-prerequisite { display:flex; align-items:center; gap:18px; justify-content:space-between; background:#fbf5e8; border:1px solid #e8d9b5; border-radius:12px; padding:18px; margin:20px 0; }
.stage-prerequisite b { font-size:14px; color:#78551f; }
.stage-prerequisite p { font-size:13px; color:#8d734c; line-height:1.7; margin:7px 0 0; }
.stage-prerequisite .btn { flex:none; }
@media(max-width:1150px) { .document-kind-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:650px) {
  .document-flow, .document-flow.compact { padding:16px; }
  .document-flow-head { display:block; }
  .document-flow-helper { text-align:left; display:block; margin-top:10px; max-width:none; }
  .document-kind-grid { gap:12px; }
  .document-kind-card { padding:18px 14px; }
  .document-kind-card>b { font-size:17px; }
  .creation-explanation,.creation-review { grid-template-columns:1fr; gap:15px; }
  .creation-wizard-steps { gap:10px; }
  .creation-wizard-steps li { font-size:12px; }
  .stage-checklist>li { padding:14px; gap:10px; }
  .stage-checklist .btn { padding:8px; font-size:12px; }
  .stage-prerequisite { align-items:flex-start; flex-direction:column; }
}
