dialog:has(.style-settings) {width:720px;max-height:calc(100vh - 24px)}
dialog:has(.style-settings) #modal-form {display:flex;flex-direction:column;max-height:calc(100vh - 26px)}
dialog:has(.style-settings) .dialog-heading,
dialog:has(.style-settings) .dialog-actions {flex-shrink:0}
dialog:has(.style-settings) .dialog-body {overflow:auto;min-height:0}
.style-settings {margin-top:24px;padding-top:20px;border-top:1px solid var(--border,#d7e0e6)}
.style-settings h3 {margin:0 0 8px;font-size:17px}
.style-settings-grid {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}
.style-connection-defaults {min-width:0;margin:0 0 16px;padding:14px;border:1px solid var(--border,#d7e0e6);border-radius:8px}
.style-connection-defaults legend {padding:0 5px;font-weight:600}
.style-connection-defaults .field {margin-bottom:12px}
.style-preview {padding:14px;border:1px solid var(--border,#d7e0e6);border-radius:8px;margin:4px 0 16px}
.style-preview-heading {display:flex;gap:12px;align-items:center;justify-content:space-between;font-size:13px}
.style-preview-heading label {display:flex;align-items:center;gap:6px;white-space:nowrap}
.style-preview-heading input[type="checkbox"] {width:16px;height:16px;min-height:0;padding:0;flex:none;accent-color:#16867a}
#diagram-style-preview {margin-top:10px;background:#f7f9fb;border-radius:6px;overflow:hidden}
#diagram-style-preview svg {display:block;width:100%;height:auto}
#style-preview-error {margin:8px 0 0;color:#b94343}
.style-preset-actions {display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.style-scope {padding:14px;margin:14px 0 20px;background:#edf7f4;border:1px solid #add3ca;border-radius:8px}
.style-scope>strong {font-size:13px}
.style-scope>p {margin:6px 0;font-size:13px;line-height:1.5}
.style-scope .style-apply {align-items:flex-start;line-height:1.4;font-weight:600;margin:12px 0 8px}
.style-apply input {flex:none;margin-top:2px}
.style-apply-help {margin:6px 0 0!important;font-size:12px!important}
.style-save-scope {flex:1;align-self:center;min-width:0;margin:0;font-size:12px;line-height:1.4;color:#526b77}
dialog:has(.style-settings) .dialog-actions {align-items:center;flex-wrap:wrap}
dialog:has(.style-settings) .dialog-actions .button {flex:none}
.attachment-fields {margin-top:18px}
.attachment-fields .field {margin-bottom:14px}
.attachment-position {display:block}
.attachment-position input {min-width:0;width:100%}
.attachment-handle {cursor:grab;outline:none;touch-action:none}
.attachment-handle:focus .attachment-knob {stroke:#18394f;stroke-width:4}
.attachment-handle:active {cursor:grabbing}
.agreement-link-actions {margin:-6px 0 16px;display:flex;align-items:center;gap:8px}
.agreement-link-actions a {text-decoration:none}
html[data-theme="dark"] .style-settings,
html[data-theme="dark"] .style-connection-defaults,
html[data-theme="dark"] .style-preview {border-color:#3b5364}
html[data-theme="dark"] #style-preview-error {color:#ffb1ad}
html[data-theme="dark"] .style-scope {background:#173e39;border-color:#3c6e65}
html[data-theme="dark"] .style-save-scope {color:#b5c7d1}
@media(max-width:540px){.style-settings-grid{grid-template-columns:1fr}.style-preview-heading{align-items:flex-start}.style-preview-heading label{font-size:12px}.style-save-scope{flex-basis:100%}}
