.studio-layout{display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,2fr);gap:24px;margin-top:24px}.studio-editor,.studio-list{display:grid;gap:16px;align-content:start}.studio-card,.studio-editor,.studio-values{border:1px solid #dbe4f3;border-radius:18px;padding:20px;background:linear-gradient(140deg,#fff,#f7f9ff)}.studio-field{display:grid;gap:8px;font-size:.9rem}.studio-field input:not([type=checkbox]),.studio-field select,.studio-field textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:10px;padding:11px 14px;background:#fff;color:#172554;font:inherit}.studio-field input:focus,.studio-field select:focus,.studio-field textarea:focus{outline:3px solid #6366f133;border-color:#6366f1}.studio-field:has(input[type=checkbox]){display:flex;align-items:center;justify-content:space-between}.studio-permissions{border:1px solid #dbe4f3;border-radius:12px;padding:12px;max-height:260px;overflow:auto}.studio-permissions .studio-field{padding:7px}.studio-values{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}.studio-values legend{font-weight:700;color:#4f46e5}.studio-card button{margin-top:12px}@media(max-width:760px){.studio-layout{grid-template-columns:1fr}}

.studio-related{display:grid;gap:14px}.studio-related .studio-card{display:flex;gap:8px;flex-wrap:wrap}.studio-related h4{width:100%;margin:0}.studio-related button{margin-top:0}.record-dialog:has(.studio-editor){max-height:90vh;overflow:auto}.studio-editor textarea{min-height:90px}

.studio-page{padding:24px;min-width:0}
.studio-page>h3,.studio-editor>h4,.studio-card>h4{margin:0;line-height:1.7}
.studio-page>.hint{margin-block:8px 20px;line-height:1.9}
.studio-layout>*{min-width:0}
.studio-editor{gap:18px;background:var(--surface,#fff)}
.studio-card{overflow-wrap:anywhere}
.studio-card .hint{margin-block:6px 10px}
.studio-list>.empty-state{min-height:0;padding:20px 16px;margin:0;gap:10px}
.studio-list>.empty-state::before{width:32px;height:32px;font-size:20px;margin:0}
.studio-field>span{line-height:1.7}
.studio-field:has(input[type=checkbox]){justify-content:flex-start;gap:12px}
.studio-field:has(input[type=checkbox])>span{flex:1}
.studio-advanced{padding:16px;border:1px solid var(--border,#dbe4f3);border-radius:14px;background:var(--surface-subtle,#f8fafc);min-width:0}
.studio-advanced>summary,.studio-permissions>summary{cursor:pointer;font-weight:700;line-height:1.8}
.studio-advanced[open]>summary{margin-block-end:18px}
.studio-advanced>.studio-field{margin-block:16px}
.studio-permissions{max-height:none;margin-block:12px;background:var(--surface,#fff)}
.studio-permissions[open]{max-height:320px}
.studio-permissions .hint{margin-block:12px;line-height:1.8}
.studio-values{min-inline-size:0;margin:0;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))}
.studio-values legend{padding-inline:8px}
.studio-values-arranged{display:flex;flex-direction:column;gap:20px}
.studio-value-section{min-width:0}.studio-value-section h4{margin:0 0 12px}
.studio-section-fields{display:grid;gap:16px}.studio-columns-1{grid-template-columns:minmax(0,1fr)}.studio-columns-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.studio-layout-dialog{width:min(900px,calc(100vw - 32px));box-sizing:border-box;padding:24px;border:1px solid var(--border);border-radius:20px;color:var(--text);background:var(--surface)}
.studio-layout-dialog>h3{margin-top:0}.studio-layout-dialog>.hint{line-height:1.9;margin-block:12px 20px}
.studio-layout-editor{display:grid;gap:18px;margin-block:20px}.studio-layout-actions,.studio-layout-field{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.studio-layout-field{margin-block:12px}.studio-layout-field strong{flex:1;min-width:140px}
.studio-layout-preview{padding:18px;background:var(--surface-subtle);border:1px dashed var(--border);border-radius:14px}.studio-layout-preview-field{padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
.record-dialog:has(>.studio-editor){box-sizing:border-box;width:min(760px,calc(100vw - 32px));padding:24px}
dialog.record-dialog>form.studio-editor{display:grid;max-height:none;overflow:visible;border:0;padding:0;background:transparent!important;box-shadow:none;gap:20px}
.record-dialog>.studio-editor>h3{margin:0;line-height:1.7}
.studio-tabs{display:flex;gap:8px;flex-wrap:wrap;padding-block-end:12px;border-bottom:1px solid var(--border)}
.studio-tab[aria-selected=true]{background:var(--accent)!important;color:#fff!important;border-color:var(--accent)!important}
.studio-tab-panel{display:grid;gap:20px;min-width:0}.studio-tab-panel[hidden]{display:none!important}
.studio-layout-dialog{max-block-size:90dvh;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.studio-layout-dialog .studio-card{display:grid;gap:16px;min-width:0}
.studio-layout-dialog .studio-card button{margin:0}
.studio-layout-preview>h4{margin-block:16px 10px;line-height:1.7}
.studio-layout-preview>h4:first-child{margin-block-start:0}
.studio-layout-actions>button{min-block-size:42px;white-space:normal;line-height:1.6}
.studio-editor .hint{margin:0;line-height:1.8}
.studio-list>.empty-state::before{content:none}
.studio-field textarea{resize:vertical;min-block-size:96px}
.studio-section-fields>.studio-field:only-child{grid-column:1/-1}
.studio-layout-dialog .studio-card .studio-layout-field{margin:0}
.record-dialog .studio-values>legend{position:absolute;inline-size:1px;block-size:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.studio-record-actions{position:sticky;inset-block-end:0;display:flex;gap:12px;flex-wrap:wrap;justify-content:flex-end;padding-block:14px 4px;background:var(--surface,#fff);border-block-start:1px solid var(--border,#dbe4f3);box-shadow:0 -8px 16px var(--surface,#fff);z-index:2}
.studio-record-actions>.hint{flex-basis:100%}.studio-record-actions>.hint:empty{display:none}
.studio-field{align-content:start}
.studio-field input:not([type=checkbox]),.studio-field select:not([multiple]){block-size:44px}
.studio-custom-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr));gap:16px;align-items:end;margin-block:20px}
.studio-page>.studio-layout-actions{margin-block:16px}
.studio-page .erp-table td:last-child>.studio-layout-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.studio-page>.hint[role=status]{margin-block:14px;line-height:1.8}
@media(max-width:760px){.studio-columns-2{grid-template-columns:minmax(0,1fr)}.studio-layout-dialog{padding:16px}}
@media(max-width:760px){.studio-page{padding:16px}.studio-layout{grid-template-columns:minmax(0,1fr);gap:16px;margin-top:18px}.studio-card,.studio-editor,.studio-values{padding:16px}.studio-advanced{padding:12px}}

/* One authorized page of records, presented as cards without extra requests. */
#workspace .studio-record-cards .data-wrap {overflow:visible;background:transparent;border:0;}
#workspace .studio-record-cards .erp-table {display:block;min-width:0;width:100%;}
#workspace .studio-record-cards .erp-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
#workspace .studio-record-cards .erp-table tbody {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:16px;}
#workspace .studio-record-cards .erp-table tr {display:flex;flex-direction:column;gap:10px;padding:20px;border:1px solid var(--border,#dce2ef);border-radius:16px;background:var(--surface,#fff);min-width:0;}
#workspace .studio-record-cards .erp-table td {display:block;width:auto;padding:0;border:0;white-space:normal;overflow-wrap:anywhere;}
#workspace .studio-record-cards .erp-table td::before {content:attr(data-label);display:block;font-size:12px;opacity:.7;margin-block-end:4px;}
#workspace .studio-record-cards .erp-table td:nth-child(2) {font-weight:700;font-size:16px;}
#workspace .studio-record-cards .erp-table td:last-child {margin-block-start:auto;padding-block-start:12px;}
#workspace .studio-record-cards .studio-layout-actions {margin:0;}

:is(#workspace,.studio-source-dialog) .studio-calendar {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin-block:16px;}
:is(#workspace,.studio-source-dialog) .studio-calendar-heading {text-align:center;font-weight:700;padding:8px 2px;font-size:12px;}
:is(#workspace,.studio-source-dialog) .studio-calendar-day {min-height:110px;min-width:0;border:1px solid var(--border,#dce2ef);border-radius:12px;padding:10px;background:var(--surface,#fff);}
:is(#workspace,.studio-source-dialog) .studio-calendar-day h4 {margin:0 0 8px;font-size:13px;}
:is(#workspace,.studio-source-dialog) .studio-calendar-event {display:flex;flex-direction:column;gap:8px;padding:10px;margin-block:8px;background:var(--surface-hover,#f2f4ff);border-radius:10px;overflow-wrap:anywhere;}
:is(#workspace,.studio-source-dialog) .studio-calendar-event .studio-layout-actions {display:flex;flex-wrap:wrap;gap:6px;}
:is(#workspace,.studio-source-dialog) .studio-calendar-event button {white-space:normal;min-width:0;padding:6px;font-size:12px;}
@media(max-width:900px){:is(#workspace,.studio-source-dialog) .studio-calendar{grid-template-columns:repeat(2,minmax(0,1fr));}:is(#workspace,.studio-source-dialog) .studio-calendar-heading,:is(#workspace,.studio-source-dialog) .studio-calendar-empty{display:none;}:is(#workspace,.studio-source-dialog) .studio-calendar-day h4::before{content:attr(data-month);}}

:is(#workspace,.studio-source-dialog) .studio-summary-chart{display:grid;gap:16px;margin-block:20px;}
:is(#workspace,.studio-source-dialog) .studio-summary-item{display:grid;grid-template-columns:1fr auto;gap:10px;padding:16px;border:1px solid var(--border,#dce2ef);border-radius:12px;}
:is(#workspace,.studio-source-dialog) .studio-summary-track{grid-column:1/-1;height:12px;background:var(--surface-hover,#eff2fa);border-radius:8px;overflow:hidden;}
:is(#workspace,.studio-source-dialog) .studio-summary-bar{height:100%;background:linear-gradient(90deg,#496bf1,#7452df);border-radius:8px;}

:is(#workspace,.studio-source-dialog) .studio-summary-values{grid-column:1/-1;display:grid;grid-template-columns:minmax(80px,1fr) minmax(0,2fr);gap:8px 16px;margin:8px 0;}
:is(#workspace,.studio-source-dialog) .studio-summary-values dd{margin:0;direction:ltr;text-align:end;overflow-wrap:anywhere;font-variant-numeric:tabular-nums;}


#workspace .studio-column-picker {align-self:start;border:1px solid var(--border,#dce2ef);border-radius:12px;background:var(--surface,#fff);}
#workspace .studio-column-picker>summary{cursor:pointer;padding:12px 14px;font-weight:600;min-height:44px;box-sizing:border-box;}
#workspace .studio-column-options{display:grid;gap:8px;padding:8px 12px 12px;max-height:220px;overflow:auto;border-top:1px solid var(--border,#dce2ef);}
#workspace .studio-column-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:8px;border-radius:8px;background:var(--surface-hover,#f5f7fc);}
#workspace .studio-column-choice input[type=checkbox]{width:18px;height:18px;min-height:18px;flex:0 0 18px;accent-color:#6652e8;}

#workspace .studio-column-picker>select[hidden]{display:none!important;}

#workspace .studio-source-columns{margin:12px 16px;max-width:420px;}
#workspace .studio-source-columns>p{padding:0 12px 10px;margin:0;}

#workspace .studio-source-display{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:12px;border-top:1px solid var(--border,#dce2ef);}
#workspace .studio-source-display select{min-height:40px;max-width:180px;}

#workspace .studio-source-columns>button{margin:0 12px 12px;}
.studio-source-dialog{width:min(1280px,94vw);max-width:94vw;}
.studio-source-output{min-width:0;}
.studio-source-dialog .studio-custom-filters{margin-block:16px;}

.studio-action-request{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding-block:12px;border-top:1px solid var(--border,#dce2ef);}

.studio-report-preview[open]{display:flex;flex-direction:column;box-sizing:border-box;width:min(960px,calc(100vw - 32px));max-width:calc(100vw - 32px);height:min(820px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);margin:auto;overflow:hidden;gap:12px}
.studio-report-preview>h3{flex:0 0 auto;margin:0;font-size:18px;line-height:1.7;overflow-wrap:anywhere}
.studio-report-preview>.studio-layout-actions{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:8px;margin:0}
.studio-report-preview>.studio-layout-actions button{min-height:44px;max-width:100%;white-space:normal;line-height:1.6}
.studio-report-preview>p{flex:0 0 auto;max-height:72px;overflow:auto;margin:0;line-height:1.7;overflow-wrap:anywhere}
.studio-report-preview iframe{display:block;box-sizing:border-box;flex:1 1 auto;min-height:0;min-width:0;width:100%;height:auto;border:1px solid var(--border,#dce2ef);border-radius:12px;background:white;margin:0}
@media(max-width:640px){.studio-report-preview[open]{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:16px}.studio-report-preview>.studio-layout-actions button{flex:1 1 130px}}

.studio-package-summary{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.9;padding:16px;background:var(--surface-hover,#f4f6fb);border-radius:12px;}

.studio-base-designer{padding:16px;border:1px solid var(--border,#dce2ef);border-radius:14px;margin-block:12px 20px;}.studio-base-designer>summary{cursor:pointer;font-weight:700;}.studio-base-designer-row{cursor:grab;}.studio-base-help{display:block;line-height:1.7;margin-block-start:5px;color:var(--text-muted,#64748b);}
.studio-composite{border:1px solid var(--border,#dce2ef);border-radius:14px;padding:12px;min-width:0;margin-top:8px}
.studio-detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:14px}
.studio-detail-row{padding:16px;border:1px solid var(--border,#dce2ef);border-radius:14px;margin:12px 0;background:var(--surface,#fff)}
.studio-detail-row>strong{display:block;margin-bottom:12px}
.studio-detail-row label{display:flex;flex-direction:column;gap:6px}
.studio-detail-editor{grid-column:1/-1;width:100%;box-sizing:border-box}
.studio-selection{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.studio-field:has(>.studio-detail-editor){grid-column:1/-1}

.studio-live-preview-field{min-width:0;display:grid;gap:8px}.studio-live-preview-field input,.studio-live-preview-field select,.studio-live-preview-field textarea{box-sizing:border-box;width:100%;min-height:42px;border:1px solid var(--border);border-radius:10px;padding:10px;background:var(--surface);color:var(--text);opacity:1}.studio-live-preview-field input[type=checkbox]{width:20px;min-height:20px}.studio-live-detail-preview{display:flex;gap:12px;flex-wrap:wrap;padding:12px;border:1px solid var(--border);border-radius:10px}.studio-live-detail-preview>.hint{flex-basis:100%}

.studio-native-document-dialog iframe{display:block;width:100%;height:540px;border:1px solid var(--border);border-radius:12px;background:white;margin-top:16px}.studio-native-document-dialog .studio-editor{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.studio-native-document-dialog .studio-layout-actions{grid-column:1/-1;flex-wrap:wrap}@media(max-width:640px){.studio-native-document-dialog .studio-editor{grid-template-columns:1fr}.studio-native-document-dialog iframe{height:420px}}

.studio-native-document-dialog .studio-column-options{grid-column:1/-1}

.studio-native-document-dialog .studio-column-options{display:grid;gap:10px;max-height:240px;overflow:auto;border-top:1px solid var(--border,#dbe4f3);padding:12px 0}.studio-native-document-dialog .studio-column-options input[type=checkbox]{width:18px;height:18px;min-height:18px;accent-color:#6652e8}

/* Studio typed conditions: readable nesting and controls within the editor. */
.studio-condition-node{min-width:0;padding:14px;border:1px solid var(--border,#dce3ef);border-radius:12px;background:var(--surface-color,#fff);margin-block:10px}
.studio-condition-content{display:grid;gap:10px;min-width:0}
.studio-condition-children{border-inline-start:3px solid #c7d2fe;padding-inline-start:12px;min-width:0}
.studio-condition-row{min-width:0;padding-block-end:8px}
.studio-condition-node>.studio-field{margin-block-end:10px}
.studio-condition-content>.secondary-action,.studio-condition-row>.secondary-action{justify-self:start;width:auto}
@media(max-width:600px){.studio-condition-node{padding:10px}.studio-condition-children{padding-inline-start:8px}}

.studio-file-widget{display:flex;flex-wrap:wrap;gap:10px;align-items:center;min-width:0;padding:12px;border:1px solid var(--border,#dce3ef);border-radius:12px;background:var(--surface-color,#fff)}
.studio-file-name{flex:1 1 100%;overflow-wrap:anywhere;font-weight:600}
.studio-file-picker{flex:1 1 240px;min-width:0;max-width:100%}
.studio-file-picker::file-selector-button{border:0;border-radius:8px;padding:9px 14px;margin-inline-end:10px;background:#eef2ff;color:#3730a3;font:inherit;cursor:pointer}
.studio-file-preview{display:block;max-width:100%;max-height:240px;object-fit:contain;border-radius:10px}
.studio-file-preview[hidden]{display:none}.studio-file-widget>.hint{flex-basis:100%;margin:0}
.studio-pivot-wrap{max-width:100%;overflow:auto;border:1px solid var(--border,#dbe3f0);border-radius:14px;margin-block:16px;background:var(--surface,#fff)}
.studio-pivot-table{width:100%;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums;white-space:nowrap}
.studio-pivot-table caption{text-align:start;font-weight:700;padding:16px;color:var(--text,#17233c)}
.studio-pivot-table th,.studio-pivot-table td{padding:12px 16px;text-align:start;border-block-start:1px solid var(--border,#e5eaf3)}
.studio-pivot-table thead th,.studio-pivot-table tfoot,.studio-pivot-total{background:var(--surface-subtle,#f1f5ff);font-weight:700}
.studio-stage-board{display:flex;gap:18px;overflow-x:auto;align-items:flex-start;padding:12px 2px 20px;scroll-snap-type:x proximity}
.studio-stage-column{flex:0 0 290px;max-width:85vw;border:1px solid var(--border,#dce4f2);border-radius:18px;padding:16px;background:var(--surface-subtle,#f4f7fd);scroll-snap-align:start}
.studio-stage-column>h4{margin:0 0 16px;color:var(--text,#17233c)}
.studio-stage-card{display:flex;flex-direction:column;gap:12px;padding:16px;margin-block:12px;background:var(--surface,#fff);border:1px solid var(--border,#e1e7f2);border-radius:14px;box-shadow:0 5px 16px #102c4a08;overflow-wrap:anywhere}
.studio-stage-card select{width:100%;min-height:42px;padding:8px 12px;border:1px solid var(--border,#cbd5e8);border-radius:10px;background:var(--surface,#fff);color:inherit;font:inherit}
