/* Additional simulation editors reuse the reference white/purple visual language. */
dialog:has(.advanced-editor){width:min(900px,calc(100% - 30px))}
.advanced-editor{display:grid;gap:16px;min-width:0}
.advanced-editor h2{display:flex;align-items:center;gap:8px;margin:0;font-size:17px}
.advanced-editor h3{margin:0 0 11px;font-size:13px;font-weight:600}
.advanced-warning{padding:11px 13px;border:1px solid #e9d3fb;border-radius:10px;background:#faf5ff;color:#8752a7;font-size:11px;line-height:1.7}
.advanced-warning strong{font-weight:600}
.advanced-limits{margin:7px 0 0;padding-left:17px;font-size:11px}
.advanced-section{padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.advanced-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.advanced-section-head h3{margin:0}
.advanced-section-head button{min-height:27px;padding:5px 9px;font-size:10px}
.advanced-fields,.advanced-task-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.advanced-fields .wide,.advanced-task-fields .wide{grid-column:1 / -1}
.advanced-fields label,.advanced-task-fields label{min-width:0}
.advanced-fields>.field,.advanced-task-fields>.field{display:grid;gap:7px;color:#687586;font-size:12px}
.advanced-fields .field-help,.advanced-task-fields .field-help{font-size:10px;font-weight:400;color:var(--muted);line-height:1.6}
.advanced-task-list{display:grid;gap:11px}
.advanced-task{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--panel-soft)}
.advanced-task-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px;font-size:11px}
.advanced-task-head strong{font-weight:500}
.advanced-task-head button{min-height:23px;padding:3px 7px;border-radius:6px;background:var(--panel);color:var(--bad);font-size:10px}
.advanced-task input,.advanced-task select{background:var(--panel)}
.advanced-choice-group{display:flex;align-items:center;flex-wrap:wrap;gap:7px 12px}
.advanced-choice{display:inline-flex;align-items:center;gap:5px;color:var(--muted);font-size:11px}
.advanced-choice input{width:13px;min-height:13px;height:13px;padding:0;accent-color:#a83de9}
.advanced-nested{margin-top:13px;padding-top:11px;border-top:1px solid var(--line)}
.advanced-nested h4{margin:0 0 10px;color:var(--muted);font-size:11px;font-weight:500}
.advanced-nested-rule{padding:10px;margin-top:8px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.advanced-nested>.advanced-task-fields+.advanced-task-fields{margin-top:10px}
.advanced-nested>.advanced-choice{margin-bottom:10px}
.advanced-json{width:100%;min-height:170px;resize:vertical;font-family:Consolas,Monaco,monospace;font-size:11px;line-height:1.6;tab-size:2}
.advanced-editor details{border:1px solid var(--line);border-radius:11px;background:var(--panel)}
.advanced-editor summary{padding:11px 13px;color:#86619c;font-size:11px;cursor:pointer;list-style-position:inside}
.advanced-detail-content{padding:0 13px 13px}
.advanced-detail-content .data-note{margin-top:0;margin-bottom:9px}
.advanced-actions{position:sticky;bottom:-23px;z-index:3;display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0 -23px -23px;padding:13px 23px;border-top:1px solid var(--line);background:var(--panel)}
.advanced-actions button{min-height:33px;font-size:11px}
.advanced-actions .advanced-enabled{display:flex;align-items:center;gap:7px;margin-right:auto;font-size:11px;color:var(--muted)}
.advanced-enabled input{width:14px;min-height:14px;height:14px;padding:0;accent-color:#a83de9}
.simulation-badge{display:inline-flex;align-items:center;gap:3px;padding:3px 6px;border-radius:5px;background:#f5e8ff;color:#ab43db;font-size:9px;line-height:1.4}
.engine-card .simulation-badge{margin-top:9px}
.simulation-replay-output{padding:14px;border:1px solid var(--line);border-radius:11px;background:var(--panel);min-width:0}
.simulation-replay-output h3{margin:0 0 10px}
.simulation-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:11px}
.simulation-summary div{padding:9px;border:1px solid var(--line);border-radius:8px;background:var(--panel-soft)}
.simulation-summary small{display:block;color:var(--muted);font-size:10px}
.simulation-summary b{display:block;margin-top:4px;font-size:13px;font-weight:500;font-variant-numeric:tabular-nums}
.simulation-errors{padding:10px 12px;border:1px solid #f0d4ba;border-radius:9px;background:#fffaf3;color:#bc864d;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.simulation-errors:empty{display:none}
.simulation-reasons{max-height:170px;overflow-y:auto;padding:10px 13px;background:var(--panel-soft);border-radius:8px;font-size:11px;color:var(--muted);line-height:1.7}
.simulation-reasons ul{margin:0;padding-left:15px}
.simulation-record-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.simulation-record-head h3{margin:0}
.simulation-run-list{display:grid;gap:13px;margin:16px 0}
.simulation-run-list details,.simulation-replay-output details{margin-top:10px}
.simulation-run-list summary{font-size:11px;color:var(--muted);cursor:pointer}
.simulation-record-table .currency-icon{width:10px;height:10px;margin-left:3px;border-radius:50%}
.simulation-record-table details pre{min-width:250px;max-width:400px;max-height:260px;white-space:pre-wrap;overflow-wrap:anywhere}
.simulation-empty{padding:21px;text-align:center;color:var(--muted);font-size:11px}
body.dark .advanced-warning{border-color:#513461;background:#302335;color:#d2a6e5}
body.dark .simulation-badge{background:#3c2748;color:#d17af6}
body.dark .simulation-errors{border-color:#5a4729;background:#352d22;color:#dab077}
body.dark .advanced-fields>.field,body.dark .advanced-task-fields>.field{color:#a0a2ad}
@media(max-width:600px){
  .advanced-editor{gap:12px}.advanced-section{padding:12px}
  .advanced-fields,.advanced-task-fields{grid-template-columns:minmax(0,1fr);gap:10px}
  .advanced-fields .wide,.advanced-task-fields .wide{grid-column:auto}
  .advanced-editor h2{font-size:16px}.advanced-actions{bottom:-20px;margin:0 -20px -20px;padding:11px 20px;flex-wrap:wrap}
  .advanced-actions .advanced-enabled{flex:1 0 100%;margin-bottom:2px}
  .simulation-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .advanced-warning{font-size:10px}.advanced-json{min-height:160px;font-size:10px}
}
