/* Station legal editor: scoped compact layout, local Prompt typography. */
:root { --font: Prompt, "IBM Plex Sans Thai", sans-serif; }
.sl-dialog { width: min(1060px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; scrollbar-gutter: stable; }
.sl-editor { padding: 0 22px 18px; font-family: Prompt, sans-serif; overflow-wrap: anywhere; }
.sl-editor *, .sl-editor *::before, .sl-editor *::after { box-sizing: border-box; }
.sl-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 0 12px; background: #fff; }
.sl-editor .sl-header h2 { font-size: 21px; margin: 0 0 4px; line-height: 1.45; }
.sl-station { margin: 0; color: var(--muted, #566478); font-size: 13px; }
.sl-dialog #sl-form { padding: 0; }
.sl-editor h3 { font-size: 15px; margin: 0 0 10px; color: var(--navy, #122b50); }
.sl-editor fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sl-editor .field { min-width: 0; margin: 0; display: grid; align-content: start; gap: 5px; }
.sl-editor .field label { font-size: 13px; }
.sl-editor input, .sl-editor select, .sl-editor textarea { max-width: 100%; min-width: 0; font: inherit; }
.sl-editor .input, .sl-editor .select { min-height: 44px; padding: 8px 10px; font-size: 14px; }
.sl-editor textarea { resize: vertical; min-height: 64px; padding: 9px 10px; }
.sl-editor .btn { white-space: normal; height: auto; min-height: 44px; padding: 9px 14px; font-size: 13px; }
.sl-editor [hidden] { display: none !important; }
.sl-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 16px; }
.sl-wide { grid-column: 1 / -1; }
.sl-box { padding: 14px 16px; border: 1px solid var(--line, #dce3ed); background: var(--paper, #f8fafc); border-radius: 12px; margin: 0 0 14px; min-width: 0; }
.sl-ai-box { background: #f2f7ff; border-color: #c7daf5; }
.sl-ai-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.sl-ai-heading h3 { margin: 0; }
.sl-badge { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: #dcebc3; color: #2b471a; }
.sl-editor .hint { font-size: 12px; margin: 6px 0 10px; }
.sl-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0; font-size: 12px; line-height: 1.6; }
.sl-check input { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue, #1665cd); }
.sl-upload { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.sl-upload .field { flex: 1 1 280px; font-size: 12px; }
.sl-upload input[type=file] { width: 100%; padding: 7px; border: 1px solid #c6d4e7; border-radius: 8px; background: #fff; min-height: 44px; font-size: 13px; }
.sl-editor #sl-status { font-size: 12px; margin: 10px 0 0; line-height: 1.6; }
.sl-editor #sl-error { margin: 8px 0 0; font-size: 13px; }
.sl-editor #sl-error:empty { display: none; }
.sl-editor .sl-scope { margin: 4px 0 12px; }
.sl-group { padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid var(--line, #dce3ed); }
.sl-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.sl-footer { padding: 0 0 14px; }
.sl-footer .sl-check { margin-top: 0; }
.sl-documents { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line, #dce3ed); }
.sl-documents summary { cursor: pointer; font-size: 14px; font-weight: 500; min-height: 30px; }
.sl-documents .sl-grid { margin-bottom: 10px; }
.sl-diff { display: grid; grid-template-columns: minmax(150px,.8fr) 1fr 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line, #dce3ed); white-space: pre-wrap; font-size: 12px; }
.sl-diff .sl-check { margin: 0; font-weight: 500; }
#sl-preview { margin-top: 12px; }
.sl-stations .panel-head { flex-wrap: wrap; gap: 12px; }
.sl-stations td { max-width: 320px; overflow-wrap: anywhere; }
.brand-nowrap { white-space: nowrap; }
@media(min-width:900px) { .sl-group:last-of-type .sl-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } .sl-group:last-of-type .field:has(#sl-bankAccountName) { grid-column: span 2; } .sl-group:last-of-type .field:has(#sl-vatRegistered) { grid-column: span 2; } }
@media(max-width:640px) {
 .sl-dialog { width: calc(100vw - 12px); max-width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
 .sl-editor { padding: 0 12px 12px; }
 .sl-header { padding-top: 12px; gap: 10px; }
 .sl-editor .sl-header h2 { font-size: 17px; }
 .sl-station { font-size: 12px; }
 .sl-header .btn { padding: 8px 12px; flex-shrink: 0; }
 .sl-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
 .sl-box { padding: 12px; }
 .sl-upload > .btn { flex: 1 1 auto; }
 .sl-actions > .btn { flex: 1 1 140px; }
 .sl-diff { grid-template-columns: minmax(0,1fr); gap: 5px; }
 .sl-stations .table-scroll { max-width: 100%; }
}
