.button{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 14px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--text);font:inherit;font-size:13px;text-decoration:none;cursor:pointer}
.button.primary,.button.success{min-height:32px;min-width:0;padding:6px 10px;border:0;border-radius:7px;background:var(--action-blue);color:#fff;font-size:13px;font-weight:600;line-height:1.5;gap:5px}
.button.primary:hover:not(:disabled),.button.success:hover:not(:disabled){background:var(--action-blue-hover)}
.button:disabled{opacity:.5;cursor:default}
.button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
.layout-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:14px 0}
.layout-actions h3{margin-right:auto}
#editor-title{overflow-wrap:anywhere;min-width:0;max-width:100%}
.layout-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:12px 0 20px}
.layout-grid .wide{grid-column:span 2}
#layout-editor label:where(:not(.layout-upload-button)){display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}
#layout-editor input:not([type=checkbox]):not([type=file]),#layout-editor select,#layout-editor textarea{width:100%;min-width:0;min-height:36px;border:1px solid var(--line);border-radius:6px;padding:7px 9px;background:#fff;color:var(--text);font:inherit;font-size:13px}
#layout-editor textarea{resize:vertical}
#layout-editor input:disabled,#layout-editor select:disabled,#layout-editor textarea:disabled{background:var(--bg)}
#layout-fields{border:0;padding:0;min-width:0}
#layout-fields>legend{font-size:14px;font-weight:600;padding:14px 0 0}
#layout-editor .check-label{flex-direction:row;align-items:center;gap:8px}
#layout-editor input[type=checkbox]{width:17px;height:17px;accent-color:var(--blue)}
.layout-group{padding:16px;border:1px solid var(--line);border-radius:10px;margin:18px 0;min-width:0}
.layout-group legend{padding:0 8px;font-size:13px;font-weight:600}
.layout-group>h4{font-size:14px;font-weight:600;padding:4px 0;color:var(--blue);margin:0}
.table-scroll{overflow:auto}
.layouts-table{width:100%;border-collapse:collapse;font-size:14px;text-align:left}
.layouts-table th{color:#102d58;font-size:13px;font-weight:700;background:#f0fbfd}
.layouts-table th,.layouts-table td{height:46px;padding:10px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
.layouts-table tbody tr:last-child td{border-bottom:0}
.layouts-table tbody tr{transition:background .16s ease-out}
.layouts-table tbody tr:hover{background:#f7fafc}
.layouts-table tbody tr:nth-child(even){background:#fbfcfd}
.layouts-table tbody tr:nth-child(even):hover{background:#f7fafc}
.layouts-table td:first-child{font-weight:500}
.field-table{min-width:980px}
.field-table td:first-child{width:74px}
.field-table td:nth-child(2){width:150px}
.field-table td:nth-child(3){min-width:160px}
.field-table td:nth-child(4){width:135px}
.field-table td:nth-child(5){width:75px}
.field-table td:nth-child(6){width:115px}
.field-details{display:grid;gap:12px;min-width:210px;padding:12px 0}
.field-table summary{padding:7px 0;cursor:pointer;color:var(--text)}
.layout-hint{font-size:12px;color:var(--muted);margin:8px 0}
.group-heading{justify-content:space-between;margin-top:26px}
.save-actions{position:sticky;bottom:-20px;background:var(--surface);border-top:1px solid var(--line);padding:16px 0;margin-bottom:0}
.layout-error,#validation-errors{color:#a12318;background:#fff1ef;padding:12px;border-radius:8px;margin-bottom:12px;font-size:13px;overflow-wrap:anywhere}
.layout-success:not(:empty){color:#087a62;background:#eaf8f3;padding:12px;border-radius:8px;margin-bottom:12px;font-size:13px}
.notice-icon{display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:#087a62;color:#fff;font-size:13px;font-weight:700}
.notice-error .notice-icon{background:#b42318}.notice-error{border-color:#f2c8c4;background:#fff8f7}
.notice-progress .notice-icon{background:transparent;border:2px solid #d5e5f5;border-top-color:var(--blue);animation:notice-spin .8s linear infinite}
.notice-content{flex:1;min-width:0}.notice-title{display:block;font-size:13px;font-weight:600;line-height:1.5}.notice-body{margin:3px 0 0;font-size:12px;line-height:1.5}
.notice-action{padding:0;margin-top:6px;border:0;background:none;color:var(--blue);font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}
.notice-close{display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--muted);font:inherit;font-size:20px;cursor:pointer}
.notice-close:hover{background:#13213b0d}.notice-close:focus-visible,.notice-action:focus-visible{outline:3px solid var(--cyan);outline-offset:2px}
#validation-errors{position:relative;padding-right:44px}#validation-errors>.notice-close{position:absolute;top:6px;right:8px}
@keyframes notice-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.notice-progress .notice-icon{animation:none}}
#validation-errors ul{padding-left:20px}
[hidden]{display:none!important}
@media(max-width:1000px){.layout-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.layout-grid{grid-template-columns:1fr}.layout-grid .wide{grid-column:span 1}.layout-group{padding:10px}.save-actions{bottom:0}.section-heading{align-items:stretch}}

.compact-list-page{position:relative;min-width:0}
.compact-list-page>.layout-results{border:1px solid var(--line);border-radius:8px;background:var(--surface);overflow:hidden}
.layouts-heading{padding:20px 20px 10px}
.layouts-heading h2{margin:0;font-size:18px;font-weight:680;line-height:1.3;letter-spacing:-.012em}
.layout-toolbar{display:flex;gap:18px;align-items:center;flex-wrap:wrap;padding:15px;border-bottom:1px solid var(--line)}
.name-filter{display:flex;align-items:center;margin-left:auto;min-width:0;flex-wrap:wrap;gap:8px}
.name-filter label{font-size:13px}.name-filter input{min-width:130px;width:210px;max-width:100%;height:36px;padding:7px 10px;border:1px solid var(--line);border-radius:4px;font:inherit;font-size:13px}
#layout-load-sentinel{height:1px}
#empty-layouts{padding:24px;text-align:center;color:var(--muted);font-size:14px}
#layouts-body tr:hover{background:#f4f8fb}#layouts-body td{vertical-align:middle}
.layout-modal-open{overflow:hidden}
#layout-editor{padding:0;border:1px solid var(--line);border-radius:7px;width:min(1180px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);color:var(--text);background:var(--surface);box-shadow:0 20px 65px #0004}
#layout-editor::backdrop{background:rgb(14 25 38 / 55%)}
.editor-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 22px;border-bottom:1px solid var(--line);background:var(--surface)}
.editor-header h3{margin:3px 0;font-size:18px}.editor-header .button{font-size:24px;border:0;padding:0 8px}
.editor-content{padding:0 22px}.revision-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:12px}
.save-actions{bottom:0;justify-content:flex-end;padding:14px 0;margin-top:12px;z-index:1}.save-actions .layout-hint{margin-right:auto}
#editor-message:empty{display:none}
@media(max-width:700px){.name-filter{margin-left:0;width:100%}.name-filter input{flex:1;width:100px}.layout-toolbar{gap:12px}.revision-toolbar{align-items:flex-start;flex-wrap:wrap}#layout-editor{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.editor-content{padding:0 12px}.editor-header{padding:12px}.save-actions .layout-hint{width:100%;margin:0}}

.config-section{border-bottom:1px solid var(--line);padding:8px 0 2px}
.config-section h4{margin:10px 0 0;font-size:14px;color:var(--text)}
.layout-grid .full-width{grid-column:1 / -1}
#layout-fields>.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0}

.row-actions-trigger{font-size:24px;line-height:1;min-width:36px;padding:0 8px}
.row-grid-actions{display:flex;align-items:center;justify-content:center;gap:4px}
:is(#layout-list,#maps-list) .row-pin-action{flex:none;width:28px;min-width:28px;min-height:30px;padding:2px 4px;border:0;background:transparent;color:var(--muted)}
.row-pin-action .action-icon,.row-pin-indicator .action-icon{flex:0 0 14px;width:14px;height:14px;stroke-width:1.6}
.row-pin-indicator{display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;min-height:30px;color:var(--blue)}
:is(#layout-list,#maps-list) .row-pin-action:hover{color:#2464a2;background:transparent}
:is(#layout-list,#maps-list) .row-pin-action[aria-pressed=true]{color:var(--blue);background:transparent}
@media(hover:hover){
  :is(#layout-list,#maps-list) .row-pin-action[aria-pressed=false]{opacity:0;pointer-events:none}
  :is(#layout-list,#maps-list) tr:is(:hover,:focus-within) .row-pin-action[aria-pressed=false]{opacity:1;pointer-events:auto}
}
.row-actions-menu{position:fixed;inset:auto;margin:0;width:220px;padding:5px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--text);box-shadow:0 5px 18px #0002}
.row-actions-menu .button{width:100%;justify-content:flex-start;text-align:left;border:0;border-radius:3px}
.row-actions-menu .button:hover,.row-actions-menu .button:focus-visible{background:var(--bg)}

/* Compact editor: related settings share rows; field cells have horizontal separators only. */
.editor-header{background:#122e55;color:#dbe8fb;padding:10px 20px;min-height:64px}
.editor-header h3{font-size:15px;margin:0;color:inherit}
.editor-header-actions{display:flex;align-items:center;gap:14px}
.editor-header .button{color:#dbe8fb;background:transparent;border:1px solid #ffffff30;border-radius:10px;width:40px;height:40px;font-size:22px}
#revision-notice{font-size:12px}
.config-rows{padding-top:14px}
.config-row{display:grid;gap:10px 14px;margin-bottom:10px;grid-template-columns:repeat(3,minmax(0,1fr))}
.config-identity{grid-template-columns:minmax(0,1fr)}
.config-description{grid-template-columns:minmax(0,1fr)}
.config-description textarea{min-height:52px}
.config-format{grid-template-columns:repeat(3,minmax(0,1fr))}
.config-options{grid-template-columns:minmax(110px,0.6fr) minmax(180px,1fr) repeat(2,minmax(0,1fr))}
#layout-editor label:where(:not(.layout-upload-button)){gap:4px}
#layout-editor input:not([type=checkbox]):not([type=file]),#layout-editor select,#layout-editor textarea{min-height:32px;padding:5px 8px}
#layout-editor .check-label{align-self:end;min-height:32px}
.group-heading{margin:16px 0 8px}.group-heading h3{font-size:14px;margin:0}
.layout-grid{gap:10px 14px;margin:10px 0}
.layout-group{border:0;border-top:1px solid var(--line);border-radius:0;padding:10px 0;margin:8px 0}
.layout-group>h4{font-size:13px;padding:3px 0}
.layout-group .record-grid{grid-template-columns:minmax(125px,1fr) minmax(105px,.85fr) minmax(170px,1.4fr) minmax(210px,2fr)}
.record-grid>.group-path{grid-column:span 2}
.layout-group .layout-actions{margin:8px 0}
.field-table th,.field-table td{border:0;border-bottom:1px solid var(--line);padding:5px 8px;vertical-align:middle}
#layout-editor .field-table td>input:not([type=checkbox]),#layout-editor .field-table td>select{border:0;border-radius:0;background:transparent;padding:5px 0}
#layout-editor .field-table td>input:focus,#layout-editor .field-table td>select:focus{background:#f0f6fd}
.field-table tbody tr:hover{background:#f8fafc}
.field-table .remove-field{border:0;background:transparent;color:#a12318;padding:4px 0}
.save-actions{padding:10px 0;margin-top:8px}
.name-filter{flex:1;justify-content:flex-end;flex-wrap:nowrap}
.keyword-filter{display:flex;align-items:center;gap:10px;border:1px solid #b6c7e0;border-radius:9px;padding:0 12px;min-height:42px;max-width:460px;flex:1;background:#fff}
.keyword-filter svg,.refresh-filter svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.keyword-filter svg{color:#60718a}
.name-filter .keyword-filter input{border:0;padding:8px 0;margin:0;min-width:0;width:100%;font-size:14px;background:transparent}
.keyword-filter:focus-within{outline:2px solid var(--cyan);outline-offset:1px}
.name-filter .keyword-filter input:focus-visible{outline:none}
.refresh-filter{min-width:44px;height:42px;padding:8px;border-radius:9px;border-color:#a6badd;background:#edf1f8;color:var(--blue)}
@media(max-width:850px){.config-identity,.config-format,.config-options{grid-template-columns:repeat(2,minmax(0,1fr))}.name-filter{flex-basis:100%}.keyword-filter{max-width:none}}
@media(max-width:600px){.config-identity,.config-format,.config-options{grid-template-columns:1fr}.editor-header{padding:10px 12px}.editor-header-actions{gap:8px}.editor-header h3{font-size:14px}#revision-notice{display:none}}
@media(max-width:1000px){.layout-group .record-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.record-grid>.record-notes{grid-column:1/-1}}
@media(max-width:600px){.layout-group .record-grid{grid-template-columns:1fr}.record-grid>.record-notes,.record-grid>.group-path{grid-column:auto}}


.feedback-buttons .button,.save-actions .button,.confirmation-actions .button,.format-actions>.button{min-width:0;min-height:32px;padding:6px 10px;border:0;border-radius:7px;font-size:13px;font-weight:600;line-height:1.5;gap:8px}
.save-actions .button:not(.primary):not(.success),.confirmation-actions .button:not(.primary):not(.success){background:#fff;color:#122e55}
#layout-confirmation{padding:0;border:1px solid var(--line);border-radius:14px;width:min(460px,calc(100vw - 32px));color:var(--text);box-shadow:0 20px 65px #0004}
#layout-confirmation::backdrop{background:rgb(14 25 38 / 55%)}
#confirmation-message{padding:22px;margin:0;overflow-wrap:anywhere;font-size:14px}
.confirmation-actions{display:flex;justify-content:flex-end;gap:12px;padding:12px 22px 20px;background:#fafbfd}

:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete]{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:24px;border-radius:12px;background:#fff;text-align:center}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .editor-header{display:none}
.confirmation-delete-close[hidden],.confirmation-delete-icon[hidden]{display:none}
.confirmation-delete-close{position:absolute;top:8px;right:8px;display:grid;place-items:center;width:28px;height:28px;padding:0;border:0;border-radius:5px;background:transparent;color:var(--text);font:inherit;font-size:20px;cursor:pointer}
.confirmation-delete-close:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.confirmation-delete-icon{display:grid;place-items:center;width:44px;height:44px;margin:0 auto 14px;border-radius:50%;background:#fce8ec;color:#dc263b}
.confirmation-delete-icon svg{width:22px;height:22px}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] :is(#confirmation-message,#map-confirmation-message,#conversion-confirmation-message){padding:0;font-size:16px;font-weight:600;line-height:1.4}
:is(#confirmation-consequence,#map-confirmation-consequence,#conversion-confirmation-consequence){margin:6px 0 0;overflow-wrap:anywhere;font-size:12px;line-height:1.5;color:var(--muted)}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .confirmation-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px;padding:0;background:transparent}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .confirmation-actions .button{min-width:0;min-height:32px;padding:6px 10px;border-radius:7px;font-size:13px}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .confirmation-actions .button:not(.primary){background:#eff3f8;color:var(--text)}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .confirmation-actions .button.primary{background:#dc263b;color:#fff}
:is(#layout-confirmation,#map-confirmation,#conversion-confirmation)[data-intent=delete] .confirmation-actions .button.primary:hover{background:#bd1d30}

/* Cadastro de layouts: organização do formulário por assunto. */
#layout-editor{width:min(980px,calc(100vw - 48px));max-height:min(90dvh,820px);border-radius:12px;border-color:#d6e3f6}
#layout-editor::backdrop{background:rgb(18 37 67 / 62%);backdrop-filter:blur(4px)}
#layout-editor .editor-header{position:relative;isolation:isolate;min-height:72px;padding:10px 18px;border-bottom:0;background:linear-gradient(110deg,#0c2343,#122e55);color:#fff}
#layout-editor .editor-header::before{content:"";position:absolute;z-index:-1;inset:0 64px 0 auto;width:280px;background:url("/static/connect-banner.svg") center / contain no-repeat;opacity:.65;pointer-events:none;mask-image:linear-gradient(to right,transparent,#000 35%)}
#layout-editor .editor-header h3{font-size:18px;font-weight:700;line-height:1.3}
#layout-editor #current-revision{display:block;margin-top:3px;font-size:12px;font-weight:400;color:#dbe8fb;opacity:.8;white-space:nowrap}
#layout-editor .editor-header .button{width:32px;height:32px;min-height:32px;font-size:20px;background:transparent;border:1px solid #ffffff30;color:#fff;border-radius:7px}
#layout-editor .editor-header .button:hover{background:#ffffff14}
@media(max-width:700px){#layout-editor .editor-header::before{display:none}}
#layout-editor .editor-content{padding:0 18px}
#layout-editor .editor-section{margin:0 0 10px;padding:8px 12px;border:1px solid #dbe7f8;border-radius:8px;background:#fff}
.editor-section-heading{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.editor-section-heading h4{font-size:14px;line-height:1.3;margin:0;color:#0c1c3a}
.editor-section-heading p,.group-heading p{font-size:12px;color:#627394;margin:2px 0 0}
.section-icon{display:grid;place-items:center;width:32px;height:32px;flex:none;border-radius:8px;background:#eaf2ff;color:var(--text);font-size:18px;font-weight:600}
#layout-editor .required-mark{color:#ec334f}
#layout-editor .config-row{margin:0 0 8px;gap:10px 12px}
#layout-editor .config-row:last-child{margin-bottom:0}
#layout-editor .config-identity{grid-template-columns:repeat(2,minmax(0,1fr))}
#layout-editor .config-description textarea{min-height:48px}
#layout-editor label:where(:not(.layout-upload-button)){font-size:12px;font-weight:500;color:#3e567c}
#layout-editor input:not([type=checkbox]):not([type=file]),#layout-editor select,#layout-editor textarea{min-height:35px;border-color:#cdddf4;border-radius:5px;font-size:13px}
#layout-editor .check-label{align-self:end;min-height:35px;color:#172746;font-size:13px}
#layout-editor input[type=checkbox]{accent-color:#075df1}
.records-panel{border:1px solid #dbe7f8;border-radius:7px;padding:8px 12px}
.records-panel .group-heading{margin:0 0 5px;align-items:flex-start}
.records-panel .group-heading h5{margin:0;font-size:14px;color:#0c1c3a}
.records-panel .group-heading .button{background:#0860ee;border-color:#0860ee;color:white;min-height:34px}
#layout-editor .layout-group{border:1px solid #e0eafa;border-radius:6px;padding:10px 12px;margin:6px 0}
#layout-editor .layout-group>h4{color:var(--text);font-size:14px}
#layout-editor .field-table th{background:#f0fbfd;color:#102d58}
#layout-editor .field-table th,#layout-editor .field-table td{padding:5px 10px}
#layout-editor .field-table .remove-field{color:#f1344d}
#layout-editor .save-actions{position:sticky;bottom:0;margin:0 -18px;padding:8px 18px;gap:8px;background:#fff;border-top:1px solid #dbe7f8;z-index:2}
#layout-editor .layout-files-section{display:grid;gap:12px;border:0;padding:0}
#layout-editor .layout-file-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media (max-width:700px){#layout-editor .layout-file-cards{grid-template-columns:1fr}}
#layout-editor #layout-draft-issues{padding:10px;border:1px solid #cbdcf4;border-radius:6px;background:#f8fbff}
#layout-editor #layout-draft-issues[hidden]{display:none}
@media(max-width:850px){#layout-editor .config-identity,#layout-editor .config-format,#layout-editor .config-options,#layout-editor .config-structure,#layout-editor .excel-settings{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){#layout-editor{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}#layout-editor .editor-header{padding:10px 12px}#layout-editor .editor-header h3{font-size:16px}#layout-editor .editor-content{padding:0 10px}#layout-editor .editor-section{padding:8px 10px}#layout-editor .config-identity,#layout-editor .config-format,#layout-editor .config-options,#layout-editor .config-structure,#layout-editor .excel-settings{grid-template-columns:1fr}.editor-section-heading{gap:10px}.records-panel .group-heading{flex-wrap:wrap}#layout-editor .save-actions{margin:0 -10px;padding:8px 10px}}

/* Campos: edicao direta na linha e separadores horizontais. */
#layout-editor .record-toggle{display:inline-flex;align-items:center;gap:5px;padding:2px 0;border:0;background:none;color:var(--text);font:inherit;font-weight:600;cursor:pointer}
#layout-editor .record-chevron{display:inline-block;font-size:20px;line-height:14px;transform:rotate(0deg)}
#layout-editor .record-toggle[aria-expanded=false] .record-chevron{transform:rotate(-90deg)}
#layout-editor .field-add-actions{margin:4px 0 8px}
#layout-editor .field-add-actions .button{border-color:#a9c7ff;color:var(--text);gap:4px}
#layout-editor .field-table-scroll{--field-row-height:42px;--field-header-height:34px;min-width:0;max-width:100%;max-height:calc(var(--field-header-height) + 6 * var(--field-row-height));overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable}
#layout-editor .field-table{width:100%;min-width:0;table-layout:fixed;border-collapse:separate;border-spacing:0}
#layout-editor .field-table th{position:sticky;top:0;z-index:1;height:var(--field-header-height);padding:5px 3px;font-size:12px;line-height:12px;overflow-wrap:anywhere}
#layout-editor .field-table td{height:var(--field-row-height);min-width:0}
#layout-editor .field-table th,#layout-editor .field-table td{border-left:0;border-right:0;border-top:0;border-bottom:1px solid var(--line);vertical-align:middle}
#layout-editor .field-table th:nth-child(1),#layout-editor .field-table td:nth-child(1){width:7%}
#layout-editor .field-table th:nth-child(2),#layout-editor .field-table td:nth-child(2){width:23%}
#layout-editor .field-table th:nth-child(3),#layout-editor .field-table td:nth-child(3){width:25%;min-width:0}
#layout-editor .field-table th:nth-child(4),#layout-editor .field-table td:nth-child(4){width:19%}
#layout-editor .field-table th:nth-child(5),#layout-editor .field-table td:nth-child(5){width:10%}
#layout-editor .field-table th:nth-child(6),#layout-editor .field-table td:nth-child(6){width:10%;text-align:center}
#layout-editor .field-table th:nth-child(7),#layout-editor .field-table td:nth-child(7){width:6%;text-align:center}
#layout-editor .field-table td>input:not([type=checkbox]){min-width:0;text-overflow:ellipsis}
@media(max-width:850px){#layout-editor .field-table th,#layout-editor .field-table td{padding:5px 3px}#layout-editor .field-table th{font-size:11px}#layout-editor .field-table td>input:not([type=checkbox]){padding:5px 2px}#layout-editor .field-more{width:100%;min-width:0;padding:0;letter-spacing:0}}
@media(max-width:600px){#layout-editor .field-table-scroll{--field-row-height:64px;--field-header-height:46px}#layout-editor .field-table th,#layout-editor .field-table td{padding:3px 1px}#layout-editor .field-table th{font-size:10px;line-height:12px}#layout-editor .field-table td>input:not([type=checkbox]),#layout-editor .field-table td .field-type-control>select{font-size:11px;padding:3px 0}#layout-editor .field-type-control{flex-wrap:wrap;justify-content:center}#layout-editor .field-type-control>select{flex-basis:100%;width:100%}#layout-editor .field-format-button{width:24px;min-width:24px;min-height:24px;font-size:14px}#layout-editor .field-table input[type=checkbox]{margin:0}}
#layout-editor .field-table td>input:not([type=checkbox]){width:100%;min-height:31px;border:1px solid transparent;border-radius:5px;padding:5px 7px;background:transparent}
#layout-editor .field-table td>select{width:100%;min-height:31px;border:1px solid transparent;border-radius:5px;padding:5px 7px;background:transparent;color:var(--text);font:inherit}
#layout-editor .field-table td>input:not([type=checkbox]):hover,#layout-editor .field-table td>input:not([type=checkbox]):focus,#layout-editor .field-table td>select:hover,#layout-editor .field-table td>select:focus{border-color:#cbdcf4;background:#fff}
#layout-editor .field-table .is-new{background:#f2f7ff}
#layout-editor .field-table .is-new td>input:not([type=checkbox]){border-color:#cbdcf4;background:#fff}
#layout-editor .field-table .is-new td>select{border-color:#cbdcf4;background:#fff}
#layout-editor .field-type-control{display:flex;align-items:center;gap:3px;min-width:0}
#layout-editor .field-type-control>select{flex:1;min-width:0}
#layout-editor .field-table td .field-type-control>select{border:1px solid transparent;border-radius:5px;background:transparent;padding:5px 2px;min-height:31px;color:var(--text);font:inherit}
#layout-editor .field-table td .field-type-control>select:hover,#layout-editor .field-table td .field-type-control>select:focus{border-color:#cbdcf4;background:#fff}
#layout-editor .field-table .is-new td .field-type-control>select{border-color:#cbdcf4;background:#fff}
#layout-editor .field-format-button{flex:none;width:30px;min-width:30px;min-height:30px;padding:2px;border:0;background:transparent;color:var(--text);font-size:17px}
#layout-editor .field-format-button.is-formatted{color:#005bcf}
#layout-editor .field-format-button:hover,#layout-editor .field-format-button:focus-visible{background:#eef5ff}
#layout-editor .field-more{min-height:26px;min-width:35px;padding:0 6px;border-color:#dae5f6;color:var(--text);font-weight:700;letter-spacing:1px}
#layout-editor .field-actions-menu{position:fixed;inset:auto;margin:0;width:215px;padding:5px;border:1px solid #cbdcf4;border-radius:8px;background:#fff;box-shadow:0 12px 35px #102d5833;z-index:10}
#layout-editor .field-actions-menu:popover-open{display:grid;gap:2px}
#layout-editor .field-actions-menu .button{justify-content:flex-start;border:0;background:#fff;text-align:left;color:var(--text)}
#layout-editor .field-actions-menu .button:hover{background:#f2f7ff}
#layout-editor .field-details{display:none;position:fixed;inset:auto;margin:0;width:min(330px,calc(100vw - 16px));max-height:min(70dvh,440px);overflow:auto;padding:15px;border:1px solid #cbdcf4;border-radius:9px;background:#fff;box-shadow:0 12px 35px #102d5833;text-align:left;z-index:10}
#layout-editor .field-details:popover-open{display:grid;gap:10px}
#layout-editor .field-format-panel{display:none;position:fixed;inset:auto;margin:0;width:min(380px,calc(100vw - 16px));max-height:min(560px,calc(100dvh - 16px));overflow:hidden;padding:0;border:1px solid #cbdcf4;border-radius:9px;background:var(--surface);box-shadow:0 12px 35px #102d5833;text-align:left;font-size:13px;line-height:1.5;z-index:10}
#layout-editor .field-format-panel:popover-open{display:flex;flex-direction:column}
#layout-editor .field-format-panel .format-header{flex:none;padding:12px 16px;border-bottom:1px solid var(--line);background:#f2f7ff}
#layout-editor .field-format-panel .format-body{display:grid;gap:12px;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:14px 16px}
#layout-editor .field-format-panel .format-body>*{min-width:0}
#layout-editor .field-format-panel h5,#layout-editor .field-format-panel p{margin:0}
#layout-editor .field-format-panel h5{color:#142f59;font-size:14px}
#layout-editor .field-format-panel p,#layout-editor .field-format-panel output{font-size:12px;color:var(--text)}
#layout-editor .field-format-panel .format-context{margin-top:3px;color:var(--muted)}
#layout-editor .field-format-panel .format-hint{color:var(--muted);overflow-wrap:anywhere}
#layout-editor .field-format-panel .format-preview{padding:9px;border-radius:5px;background:#f2f7ff}
#layout-editor .field-format-panel .format-actions{display:flex;flex:none;justify-content:flex-end;gap:8px;padding:10px 16px;border-top:1px solid var(--line);background:var(--surface)}
#layout-editor .field-format-panel .field-config-add{padding:0;border:0}
#layout-editor .field-format-panel .add-field-config{justify-content:flex-start;gap:6px;white-space:normal;text-align:left}
#layout-editor .field-format-panel .allowed-values-config h6{margin:0;font-size:12px;color:var(--text)}
#layout-editor .field-format-panel .allowed-values-summary{padding:8px 10px;border-left:3px solid #b9d0f7;background:#f8fbff;font-size:12px;white-space:normal;overflow-wrap:anywhere}
#layout-editor .field-format-panel .decimal-scale[hidden]{display:none}
#layout-editor .field-details .remove-field{border:1px solid #f5bac2;border-radius:6px;padding:7px;color:#ba2339;background:#fff}
#layout-editor .field-details h5,#layout-editor .field-details h6{margin:0;color:#142f59;font-size:14px}
#layout-editor .field-details h6{font-size:12px}
#layout-editor .field-config-add{display:grid;gap:7px;padding:10px 0;border-top:1px solid var(--line)}
#layout-editor .field-config-add .button,#layout-editor .allowed-values-config .button{min-height:31px;padding:5px 9px;color:var(--text);border-color:#b9d0f7}
#layout-editor .allowed-values-config{display:grid;gap:8px;padding:10px;border:1px solid #dbe7f8;border-radius:7px;background:#f8fbff}
#layout-editor .allowed-values-config[hidden]{display:none}
#layout-editor .allowed-value-row{display:flex;gap:7px}
#layout-editor .allowed-value-row input{flex:1;min-width:0}
#layout-editor .allowed-value-row .button{min-width:30px;padding:4px}
#layout-editor .allowed-values-config .layout-actions{gap:7px;margin:0}
#layout-editor .allowed-values-summary{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);font-size:11px;text-align:left}
.wizard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0 12px}
.wizard-steps{display:flex;gap:6px;flex-wrap:wrap;padding:0;min-width:0}
@media(max-width:700px){.wizard-toolbar{flex-wrap:wrap}#layout-editor [aria-labelledby="structure-heading"] .editor-section-heading{flex-wrap:nowrap}}
.wizard-steps>[data-step-label]{display:flex;align-items:center;gap:8px;color:#536b91;font-size:12px}
.wizard-steps>[data-step-label]:not(:last-child)::after{content:"";width:26px;height:1px;background:#6b95d6;margin:0 6px}
.wizard-steps .step-number{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#edf2f8;color:#193760;font-size:12px;flex:none}
.wizard-steps .is-current{color:var(--action-blue);font-weight:700}
.wizard-steps .is-current .step-number{background:var(--action-blue);color:#fff}
.review-group{margin-top:8px;border-top:1px solid #9aacc5}
.review-group:first-child{margin-top:0}
.review-group h5{display:flex;align-items:center;gap:10px;margin:0 0 7px;color:#607ca5;font-size:11px;font-weight:600;text-transform:uppercase}
.review-group h5 span{color:#163d79;font-size:18px}
.review-row{display:grid;grid-template-columns:20px minmax(160px,1fr) minmax(0,1.6fr) auto;align-items:center;gap:10px;width:100%;max-width:1000px;min-height:34px;margin:0 auto;padding:3px 8px;border:0;border-bottom:1px solid #dce7f8;border-radius:0;font-size:12px}
.review-row strong{font-weight:500;line-height:1.4}
.review-detail{color:#607ca5;line-height:1.4}
.review-status{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#8090b0;color:#fff;font-weight:700;font-size:13px}
.review-success .review-status{background:#36c88b}
.review-error{background:#fff3f5;border-bottom-color:#ffe4e9}
.review-error .review-status{background:#ed5260}
.review-warning{background:#fff9ee;border-bottom-color:#ffe9bf}
.review-warning .review-status{background:#f5a400}
#layout-editor .review-action{padding:3px 10px;min-height:28px;color:#005bcf;font-size:11px}
@media(max-width:700px){.wizard-steps>[data-step-label]{gap:5px;font-size:11px}.wizard-steps>[data-step-label]:not(:last-child)::after{width:12px;margin:0 2px}.review-row{grid-template-columns:22px minmax(0,1fr) auto;gap:8px}.review-detail{grid-column:2 / -1;grid-row:2}.review-row strong{grid-column:2}.review-action{grid-column:3;grid-row:1}}

#layout-editor .editor-section[hidden],#wizard-review[hidden],#layout-editor .save-actions .button[hidden]{display:none!important}
#wizard-review p{margin:8px 0}
@media(max-width:600px){.wizard-steps{display:flex;flex-wrap:wrap}.save-actions{flex-wrap:wrap}}

/* Resumo de registros com detalhes expansíveis. */
#layout-editor .records-panel{padding:10px 12px;border-radius:9px}
#layout-editor .records-panel .group-heading{align-items:center;margin:0 0 10px}
#layout-editor .records-panel .group-heading h5{font-size:14px}
#layout-editor #add-group{min-height:34px;border:1px solid #cbdcf4;border-radius:7px;background:#fff;color:#0860ee}
#layout-editor .records-table{overflow-x:auto}
#layout-editor .records-table-head,#layout-editor .record-summary{display:grid;grid-template-columns:30px minmax(0,.6fr) minmax(0,1.3fr) minmax(88px,.8fr) minmax(0,2.8fr) 48px;align-items:center;gap:6px;min-width:0}
#layout-editor .records-table-head{min-height:32px;padding:0 10px;background:#f3f8fc;color:#587099;font-size:11px;font-weight:600}
#layout-editor .records-table-head span:last-child{text-align:center}
#layout-editor .layout-group{margin:0;padding:0;border:0;border-bottom:1px solid #dbe7f8;border-radius:0}
#layout-editor .record-summary{min-height:34px;padding:1px 10px;font-size:12px}
#layout-editor .record-grip{color:#536e9b;text-align:center;font-size:17px;cursor:grab}
#layout-editor .layout-group.is-dragging{opacity:.55}
#layout-editor .record-data-section,#layout-editor .record-fields-section{display:grid;gap:10px}
#layout-editor .record-data-section{padding-bottom:14px;border-bottom:1px solid #e3ebf7}
#layout-editor .record-fields-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
#layout-editor .record-fields-heading h5,#layout-editor .record-data-section h5{margin:0;font-size:13px;color:#233b62}
#layout-editor .record-count{width:max-content;max-width:100%}
#layout-editor .record-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#536b91}
#layout-editor .record-toggle{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0860ee;font-size:12px}
#layout-editor .record-more{min-height:27px;min-width:28px;width:28px;padding:0;color:#233b62}
#layout-editor .record-body{min-width:0;padding:12px 16px 16px;background:#fbfdff;border-top:1px solid #e3ebf7}
#layout-editor .record-actions-menu{position:fixed;inset:auto;margin:0;width:170px;padding:5px;border:1px solid #cbdcf4;border-radius:8px;background:#fff;box-shadow:0 12px 35px #102d5833;z-index:10}
#layout-editor .record-actions-menu:popover-open{display:grid;gap:2px}
#layout-editor .record-actions-menu .button{justify-content:flex-start;border:0;background:#fff;text-align:left;color:var(--text)}
#layout-editor .record-actions-menu .button:hover{background:#f2f7ff}

.generation-notice{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px;margin:8px 0;border:1px solid #cbdcf4;border-radius:8px;background:#f0f7ff;color:#193760;font-size:13px}
.wizard-toolbar{justify-content:flex-start}
.wizard-toolbar .wizard-steps{margin-right:auto}
#generation-editor-notice ul{flex-basis:100%;margin:0;padding-left:20px}
#generation-editor-notice.is-processing{flex-wrap:nowrap;justify-content:flex-start;gap:8px;margin:0;padding:4px 0;border:0;background:transparent;font-size:12px;line-height:17px}
#generation-editor-notice.is-processing::before{content:"";flex:0 0 14px;width:14px;height:14px;box-sizing:border-box;border:2px solid #cbdcf4;border-top-color:#075df1;border-radius:50%;animation:layout-assistant-progress 1s linear infinite}
@keyframes layout-assistant-progress{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#generation-editor-notice.is-processing::before{animation:none}}

#layout-editor .record-toggle{display:flex;align-items:center;gap:7px}
#layout-editor .record-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
#layout-editor .record-code{color:#536b91;white-space:pre}
#layout-editor .record-code,#layout-editor .record-name,#layout-editor .record-description{min-width:0;overflow:hidden;text-overflow:ellipsis}
#layout-editor .record-name,#layout-editor .record-count,#layout-editor .record-description{white-space:nowrap}

#layout-activation{padding:22px 22px 0;border:1px solid var(--line);border-radius:14px;width:min(460px,calc(100vw - 32px));color:var(--text);box-shadow:0 20px 65px #0004}
#layout-activation::backdrop{background:rgb(14 25 38 / 55%)}
#layout-activation h3{margin:0 0 18px;font-size:18px}
#layout-activation label{display:grid;gap:8px}
#layout-activation select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px;color:var(--text);background:#fff}
#layout-activation .confirmation-actions{margin:20px -22px 0;border-radius:0 0 14px 14px}

/* Cabeçalhos compactos compartilhados por Layouts e Mapeamentos. */
:is(#layout-editor,#map-editor) .editor-section-heading{align-items:center;gap:8px;margin-bottom:8px}
:is(#layout-editor,#map-editor) .editor-section-heading>div{min-width:0;flex:1}
:is(#layout-editor,#map-editor) .editor-section-heading>div>h4{margin:0;font-size:14px;line-height:16px}
:is(#layout-editor,#map-editor) .editor-section-heading>div>p{margin:0;font-size:12px;line-height:14px;overflow-wrap:anywhere}
:is(#layout-editor,#map-editor) .editor-subsection-heading{margin-top:12px}

:is(#layout-editor,#map-editor) .editor-subsection{margin-top:12px}
:is(#layout-editor,#map-editor) .section-disclosure-summary{list-style:none;cursor:pointer;position:relative;padding-right:22px}
:is(#layout-editor,#map-editor) .section-disclosure-summary::-webkit-details-marker{display:none}
:is(#layout-editor,#map-editor) .section-disclosure-summary::after{content:"⌄";position:absolute;right:0;top:0;color:#536b91;font-size:18px;line-height:32px}
:is(#layout-editor,#map-editor) .section-disclosure-summary:focus-visible{outline:2px solid #075df1;outline-offset:3px;border-radius:3px}
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary .section-icon,
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary p,
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary button{display:none!important}
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary .editor-section-heading,
#layout-editor .records-panel>.section-disclosure:not([open])>.section-disclosure-summary .group-heading{margin:0}
:is(#layout-editor,#map-editor) .layout-upload-area>.section-disclosure>.section-disclosure-content{display:grid;gap:8px}
#layout-editor .record-data-section>.section-disclosure>.section-disclosure-content,
#layout-editor .record-fields-section>.section-disclosure>.section-disclosure-content{display:grid;gap:10px}
.wizard-steps>button[data-step-label]{padding:0;border:0;background:none;font:inherit;cursor:pointer;text-align:left}
.wizard-steps>button[data-step-label]:focus-visible{outline:2px solid var(--action-blue);outline-offset:4px;border-radius:4px}
.wizard-steps>button[data-step-label]:disabled{cursor:wait;opacity:.6}

:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary .file-info{display:none}
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary h4,
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary h5{margin:0}

/* Primeira etapa: dados diretos e anexos compactos. */
#layout-editor .layout-general-section{padding:0 2px;border:0;background:transparent;margin-bottom:12px}
#layout-editor .description-editor{position:relative;display:block}
#layout-editor .description-editor textarea{display:block;min-height:66px;padding-bottom:24px;resize:vertical}
#layout-description-count{position:absolute;right:10px;bottom:6px;font-size:11px;color:#536b91;pointer-events:none}

#layout-editor .layout-general-section>h4,#layout-editor .layout-compact-files>h4{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* Grids iniciais: visibilidade independente do status. */
.compact-list-page .layout-list-grid{table-layout:fixed;min-width:0;font-size:13px}
#layout-list .layout-status-column{width:8%}
#layout-list .layout-visibility-column{width:150px}
#layout-list .layout-user-column{width:18%}
.compact-list-page .layout-list-grid th,.compact-list-page .layout-list-grid td{height:36px;padding:5px var(--grid-cell-inline-padding,10px);text-align:left;overflow-wrap:anywhere}
.compact-list-page .layout-list-grid th{height:34px;background:#f3faff;color:#102d58;font-size:12px}
.compact-list-page .layout-list-grid tbody tr:nth-child(even){background:#fff}
.compact-list-page .layout-list-grid tbody tr:hover{background:#f7fafc}
.compact-list-page .layout-list-grid th:last-child,.compact-list-page .layout-list-grid td:last-child{text-align:center;padding-left:8px;padding-right:8px}
.compact-list-page .layout-grid-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}
:is(#layout-list,#maps-list,.version-state-section) .layout-situation{max-width:100%}
#layout-list .layout-status{max-width:100%}
.compact-list-page .row-actions-trigger{min-width:28px;min-height:30px;padding:2px 4px;border-color:#e2eaf5;background:#fff;font-size:20px}
.compact-list-page .layout-grid-sort{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:700;cursor:pointer;white-space:normal;overflow-wrap:anywhere;text-align:left}
@media(max-width:850px){
#layout-editor .field-table .field-more{width:100%;min-width:0;padding:0;letter-spacing:0}
#layout-editor .records-table-head,#layout-editor .record-summary{min-width:0;grid-template-columns:20px minmax(0,.6fr) minmax(0,1.3fr) minmax(88px,.8fr) minmax(0,2.8fr) 28px}
}
@media(max-width:600px){
#layout-editor .field-type-control>select{flex:1 1 100%;width:100%}
#layout-editor .field-format-button{width:24px;min-width:24px;min-height:24px;font-size:14px}
#layout-editor .record-body{padding:10px 4px}
#layout-editor .record-fields-heading{flex-wrap:wrap;gap:4px}
#layout-editor .field-table-scroll{--field-row-height:66px}
#layout-editor .field-table{width:calc(100% - 1px)}
#layout-editor .field-table th:nth-child(1),#layout-editor .field-table td:nth-child(1){width:9%}
#layout-editor .field-table th:nth-child(2),#layout-editor .field-table td:nth-child(2),#layout-editor .field-table th:nth-child(3),#layout-editor .field-table td:nth-child(3){width:18%}
#layout-editor .field-table th:nth-child(4),#layout-editor .field-table td:nth-child(4){width:21%}
#layout-editor .field-table th:nth-child(5),#layout-editor .field-table td:nth-child(5){width:12%}
#layout-editor .field-table th:nth-child(6),#layout-editor .field-table td:nth-child(6){width:14%}
#layout-editor .field-table th:nth-child(7),#layout-editor .field-table td:nth-child(7){width:8%}
}

/* Listagens fluem na largura do painel, incluindo em telas estreitas. */
:is(#layout-list,#maps-list) .table-scroll{container-type:inline-size}
:is(#layout-list,#maps-list) .layouts-table{width:100%;table-layout:fixed;font-size:13px}
:is(#layout-list,#maps-list) .layouts-table th,:is(#layout-list,#maps-list) .layouts-table td{height:36px;padding:5px 10px;overflow-wrap:anywhere}
:is(#layout-list,#maps-list) .layouts-table th{font-size:12px}
:is(#layout-list,#maps-list) .layout-toolbar{gap:10px}
.compact-list-page .row-actions-trigger{min-width:28px;min-height:30px;padding:2px 4px}
#maps-list .layout-status{max-width:100%}
@container(max-width:640px){
  :is(#layout-list,#maps-list) .layouts-table th,:is(#layout-list,#maps-list) .layouts-table td{padding:6px 3px}
  :is(#layout-list,#maps-list,#publications-list) .layouts-table th,:is(#layout-list,#maps-list,#publications-list) .layouts-table td{font-size:12px}
  #layout-list .layout-status-column{width:9%}
  #layout-list .layout-visibility-column{width:150px}
  #layout-list .layout-user-column{width:22%}
  .compact-list-page .layout-grid-name{white-space:normal}
  .compact-list-page .layout-grid-sort{gap:3px;flex-wrap:wrap}
  .compact-list-page .layout-list-grid th:last-child,.compact-list-page .layout-list-grid td:last-child{padding-inline:2px}
  #maps-list th:last-child,#maps-list td:last-child{padding-inline:2px}
}


/* Acordeao comum dos cadastros, inspirado no Accordion default do Mantine. */
:is(#layout-editor,#map-editor) :is(.editor-section,.editor-subsection,.layout-upload-area,.records-panel,.record-data-section,.record-fields-section,.map-layout-documents,#map-proposal,#map-history):not(.attachment-card):has(>.section-disclosure) { padding:0; margin:0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:transparent; }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary { display:block; min-height:52px; padding:10px 42px 10px 12px; border-radius:0; color:var(--text); }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary:hover { background:#f7f9fc; }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary::after { content:''; width:8px; height:8px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; right:16px; top:50%; transform:translateY(-70%) rotate(45deg); transition:transform .15s ease; font-size:inherit; line-height:normal; }
:is(#layout-editor,#map-editor) .section-disclosure[open]>.section-disclosure-summary::after { transform:translateY(-30%) rotate(225deg); }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary :is(.editor-section-heading,.group-heading,.layout-upload-heading) { margin:0; }
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary .section-icon { display:grid!important; }
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary p { display:block!important; }
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary button { display:inline-flex!important; }
:is(#layout-editor,#map-editor) .section-disclosure:not([open])>.section-disclosure-summary .file-info { display:inline!important; }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-content { padding:4px 12px 14px; }
:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary:focus-visible { outline:2px solid var(--blue); outline-offset:-2px; border-radius:0; }
@media(prefers-reduced-motion:reduce){:is(#layout-editor,#map-editor) .section-disclosure>.section-disclosure-summary::after{transition:none}}


/* Visibility badges are independent of operational status and menu actions. */
.action-icon{width:18px;height:18px;flex:0 0 18px;vertical-align:middle}
.action-with-icon{display:flex;align-items:center;gap:9px}
.entity-visibility{width:130px}
.entity-visibility .action-icon{width:14px;height:14px;flex-basis:14px}

:is(#layout-list,#maps-list) .layout-grid-user{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* A situação da edição usa os componentes locais na etapa final de revisão. */
.version-state-section{flex:none;margin:8px 0 0}
.version-state-content{display:flex;align-items:center;gap:12px;font-size:13px}
.version-state-content>[role=status]{flex:1;min-width:0}
.version-state-content small,.version-grid-detail{display:block;margin-top:3px;color:var(--muted,#64748b);font-size:12px}
.version-state-content .layout-situation{flex:none}
.version-state-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.version-changes{padding-left:20px;line-height:1.7}
#version-comparison .editor-content{overflow:auto;min-height:0}
@media(max-width:700px){.version-state-content{flex-wrap:wrap;gap:8px}.version-state-content>[role=status]{flex-basis:60%}.version-state-actions{margin-left:auto}}

.finalization-options{display:grid;gap:14px;margin:18px 0 0;padding:12px 0 0;border:0;border-top:1px solid var(--line)}
.finalization-options legend{padding:0 8px 0 0;font-size:13px;font-weight:600}
:is(#layout-editor,#map-editor) .finalization-options label{display:flex;align-items:flex-start;gap:9px;cursor:pointer}
:is(#layout-editor,#map-editor) .finalization-options input[type=radio]{flex:none;width:16px;height:16px;min-height:16px;margin:2px 0 0;padding:0;accent-color:var(--blue)}
.finalization-options strong{display:block;font-size:13px;font-weight:500}
.finalization-options small{display:block;margin-top:3px;color:var(--muted);font-size:12px}
:is(#layout-editor,#map-editor) [hidden].version-state-section{display:none!important}
#map-final-review{margin:12px 0 0;font-size:12px;color:var(--muted)}

#layout-editor #layout-version-state{border:0;border-radius:0;margin:0;padding:0}
.layout-save-summary{display:grid;grid-template-columns:130px minmax(0,1fr);gap:8px 16px;margin:0;font-size:13px}
.layout-save-summary dt{color:var(--muted)}
.layout-save-summary dd{margin:0;overflow-wrap:anywhere}
#layout-save-state,#layout-historical-revision{font-size:12px;color:var(--muted)}
@media(max-width:480px){.layout-save-summary{grid-template-columns:minmax(0,1fr);gap:2px}.layout-save-summary dd{margin-bottom:8px}}

/* Revisão de Layouts: mesma borda contínua dos grupos de Mapeamentos. */
#layout-editor #wizard-checks>.review-group.editor-section { margin:0 0 6px; padding:0; border:1px solid #dce5f0; border-radius:6px; overflow:hidden; }
#layout-editor #wizard-checks .section-disclosure>.section-disclosure-summary { box-sizing:border-box; min-height:34px; padding:4px 32px 4px 8px; }
#layout-editor #wizard-checks .section-disclosure>.section-disclosure-content { padding:0; }
#layout-editor #wizard-checks .review-row { box-sizing:border-box; max-width:none; margin:0; overflow-wrap:anywhere; }
#layout-editor #wizard-checks .review-row:last-child { border-bottom:0; }
#layout-editor #wizard-checks .review-row { grid-template-columns:24px minmax(0,1fr) minmax(0,1.3fr) 28px; }
#layout-editor #wizard-checks .review-action { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; min-width:28px; min-height:28px; padding:5px; border:0; background:transparent; color:#72819a; border-radius:4px; box-shadow:none; }
#layout-editor #wizard-checks .review-action svg { width:16px; height:16px; }
#layout-editor #wizard-checks .review-action:hover { background:#eef3f8; color:#3d5c83; }
#layout-editor #wizard-checks .review-action:focus-visible { outline:2px solid #075df1; outline-offset:-2px; }
@media(max-width:700px) { #layout-editor #wizard-checks .review-row { grid-template-columns:22px minmax(0,1fr) 28px; } }

/* Review decisions remain next to the existing action, without changing the modal size. */
#layout-editor #wizard-checks .review-row{grid-template-columns:24px minmax(0,1fr) minmax(0,1.3fr) auto}
#layout-editor .review-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:2px}
#layout-editor .review-row-actions>[hidden]{display:none!important}
#layout-editor .review-ignored{background:#f5f7fa}
#layout-editor .review-ignored .review-status{background:#8090a6}
#layout-editor .review-ignored .review-detail{color:#697c95}
#layout-editor #layout-version-state{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
#layout-editor #layout-version-state>.editor-section-heading,#layout-editor .layout-save-summary{flex:none}
#layout-final-review{display:flex;flex-direction:column;min-height:0;flex:1;margin-top:14px;padding-top:12px;border-top:1px solid var(--line);overflow-y:auto;overscroll-behavior:contain}
#layout-final-review h4{margin:0 0 6px;font-size:12px;font-weight:600}
#layout-final-review-summary{margin:0 0 8px;color:var(--muted);font-size:12px}
.layout-final-review-list{list-style:none;margin:0;padding:0;font-size:12px}
.layout-final-review-list>li{position:relative;display:grid;gap:3px;padding:8px 0 8px 27px;border-bottom:1px solid #dce7f8;overflow-wrap:anywhere}
.layout-final-review-list>li::before{content:'!';display:grid;place-items:center;position:absolute;left:0;top:8px;width:18px;height:18px;border-radius:50%;background:#f5a400;color:#fff;font-weight:600}
.layout-final-review-label{font-weight:500}
#layout-editor .layout-native-profile { display:flex; align-items:end; flex-wrap:wrap; gap:8px 12px; margin-top:12px; }
#layout-editor .layout-native-profile[hidden] { display:none; }
#layout-editor .layout-native-profile label { flex:1; min-width:180px; }
#layout-editor .layout-native-profile p { flex-basis:100%; margin:0; font-size:12px; color:var(--muted); }
#layout-editor .review-points{margin:5px 0 0;padding-left:17px;list-style:disc;line-height:1.5}
#layout-editor .review-points>li{margin:3px 0;overflow-wrap:anywhere}
@media(max-width:700px){#layout-editor #wizard-checks .review-row{grid-template-columns:22px minmax(0,1fr) auto}.review-row-actions{grid-column:3;grid-row:1}}
/* Histórico: mesma densidade dos detalhes de conversão. */
#layout-history{--dialog-width:820px}
#layout-history .editor-header{min-height:46px;padding:7px 14px}
#layout-history .editor-header h3{font-size:16px}
#layout-history .editor-content{gap:10px;padding:12px 14px}
#layout-history .history-identification{margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#layout-history col.history-count-column{width:90px}
#layout-history .history-count,#layout-history th:last-child{text-align:center}
#layout-history .history-revision{cursor:pointer}
#layout-history .history-revision:focus-visible{outline:2px solid var(--cyan);outline-offset:-2px}
#layout-history .history-value{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
#layout-history .history-detail>td{padding:8px 10px;background:#f3f7fd}
#layout-history .history-diff{width:100%;table-layout:fixed;border-collapse:collapse;border:1px solid var(--line);border-radius:6px;overflow:hidden}
#layout-history .history-diff :is(th,td){position:static;height:24px;padding:3px 10px;font-size:12px;line-height:18px;text-align:left;border:0;border-bottom:1px solid #edf2fa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#layout-history .history-diff th{height:26px;background:#e5f0ff;color:#102d58;font-weight:600}
#layout-history .history-diff tbody tr:nth-child(odd){background:#f3f7fd}
#layout-history .history-diff tbody tr:nth-child(even){background:#fff}
#layout-history .history-diff th:first-child{width:44%}
#layout-history .history-diff td:nth-child(2){color:#792e28}
#layout-history .history-diff td:nth-child(3){color:#197841}

#layout-history .history-tooltip{position:fixed;inset:auto;margin:0;max-width:min(560px,calc(100vw - 16px));max-height:calc(100dvh - 16px);overflow:auto;padding:8px 10px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--text);font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 6px 18px #102d5824}
#layout-history .history-diff th:first-child{width:auto}

#layout-history .consultation-grid col.grid-datetime-column{width:var(--grid-datetime-width)}
#layout-history .grid-datetime,#layout-history .grid-datetime .history-value{white-space:nowrap;text-align:center;overflow:visible;text-overflow:clip;font-variant-numeric:tabular-nums}
#layout-history .consultation-grid>thead th:nth-child(2){text-align:center}
#layout-history .consultation-grid>thead th:nth-child(2) .layout-grid-sort{justify-content:center;width:100%}
#layout-history .consultation-grid>thead th{white-space:nowrap}
