#historical-dialog{width:min(1140px,96vw);max-width:1140px;max-height:94dvh;padding:0;border:0;border-radius:16px;color:var(--text,#182638);background:var(--surface,#fff)}
#historical-dialog::backdrop{background:rgba(15,28,44,.56)}
#historical-dialog .drawer-header{border-bottom:1px solid #dde4eb;align-items:flex-start}
#historical-dialog .drawer-header h2{margin:5px 0 6px}
#historical-dialog .drawer-header p{margin:0;font-size:14px}
#historical-dialog .drawer-body{max-height:calc(94dvh - 210px);overflow:auto;padding:22px 28px}
#historical-dialog .drawer-footer{gap:16px;flex-wrap:wrap;border-top:1px solid #dde4eb}
.history-fieldset{border:0;padding:0;margin:0;min-width:0}
.history-kicker{font-size:11px;letter-spacing:.08em;color:#80521d;font-weight:800}
.history-entry{margin:0 0 18px;padding:15px;background:#fff8e9;border:1px solid #ead7a9;border-radius:10px;display:flex;gap:18px;align-items:center;flex-wrap:wrap}
.history-entry p{margin:5px 0 0;font-size:13px;max-width:520px}.history-entry button{margin-left:auto}
.history-list{padding:22px;margin:0 0 24px}.history-list h2{margin:6px 0}.history-list p{line-height:1.5}
.history-start-row,.history-footer-actions{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.history-start-row{margin:16px 0}.history-start-row .field{flex:1;min-width:240px}
.history-status{display:inline-block;padding:5px 10px;background:#edf3fa;color:#24476b;border-radius:6px;font-size:12px;font-weight:700}
.history-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}
.history-steps>div{padding:14px;border:1px solid #dce5ee;border-radius:10px;background:#f8fafc;display:grid;gap:6px}
.history-steps span,.history-steps small{font-size:12px}.history-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.history-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.history-grid>.field{min-width:0}
.history-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;border:1px solid #e1e7ec;padding:13px;border-radius:9px;margin:10px 0;background:#fbfcfd}
.history-row .link-button{grid-column:1/-1;justify-self:end}
.history-stage{padding:16px;margin:14px 0;background:#f8fafc;border:1px solid #dce5ee;border-radius:10px}
.history-stage>.field{margin-top:13px}.history-stage h4{margin:0 0 12px}
.history-fieldset>h4{font-size:16px;margin:26px 0 8px}.history-fieldset>.field{margin:16px 0}
.history-confirm{display:flex;gap:10px;align-items:flex-start;font-size:14px;line-height:1.6;margin:22px 0;padding:15px;background:#eff6f5;border:1px solid #cee1dd;border-radius:9px}
.history-confirm input{margin-top:4px;min-width:18px;width:18px;height:18px;accent-color:#215948}
.history-notice,.history-warning{padding:16px;border-radius:10px;line-height:1.6;background:#fff7e6;border:1px solid #eedcaf;margin:16px 0}
.history-checklist{padding:12px 16px;background:#fff7e6;border-radius:9px;margin:15px 0}
.history-checklist summary{cursor:pointer;font-weight:700}.history-checklist li{margin:7px 0}.history-ready{color:#276d50;font-size:13px}
.history-table-wrap{overflow:auto;border:1px solid #dce5ee;border-radius:10px}
.history-table{border-collapse:collapse;width:100%;font-size:13px}
.history-table th,.history-table td{padding:11px 13px;border-bottom:1px solid #e3e9ef;text-align:right;white-space:nowrap}
.history-table th:first-child{text-align:left;white-space:normal;min-width:230px}.history-table thead{background:#eef3f8}
.history-table tr:nth-child(6),.history-table tr:nth-child(7),.history-table tr:nth-child(8){background:#edf5f1;font-weight:700}
.history-actions{margin-top:28px;border-top:1px solid #dde4eb;padding-top:15px}.history-actions summary{cursor:pointer}
#historical-dialog input:disabled,#historical-dialog textarea:disabled,#historical-dialog select:disabled{opacity:1;color:#34445a;-webkit-text-fill-color:#34445a;background:#f1f4f7}
@media(max-width:760px){
 #historical-dialog{width:100vw;max-width:100vw;max-height:100dvh;border-radius:0;margin:0;height:100dvh}
 #historical-dialog .drawer-body{padding:16px;max-height:calc(100dvh - 215px)}
 #historical-dialog .drawer-header,#historical-dialog .drawer-footer{padding:15px}
 .history-grid,.history-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 .history-steps{gap:6px}.history-steps>div{padding:9px}.history-steps strong{font-size:12px}
 .history-entry button{margin-left:0}.history-footer-actions{width:100%}
 .history-footer-actions .button{flex:1;font-size:12px}.history-list{padding:16px}
}
@media(max-width:440px){.history-grid,.history-row{grid-template-columns:1fr}.history-tabs .button{font-size:12px;padding:8px}.history-steps small{overflow-wrap:anywhere}}
#historical-dialog{margin:auto;inset:0;height:94dvh;overflow:hidden}
#historical-dialog[open]{display:flex;flex-direction:column}
#historical-dialog .drawer-body{min-height:0;max-height:none;flex:1}
#historical-dialog .drawer-header,#historical-dialog .drawer-footer{flex-shrink:0}
@media(max-width:760px){#historical-dialog{height:100dvh;margin:0}}
