﻿/* Geometría de pantalla compartida. La barra ya ocupa espacio en el flujo:
   no volver a reservar su altura como padding del área de trabajo. */
@media screen {
 body.signed-in31 #workspace.shell{padding-top:0!important;height:calc(100dvh - var(--appbar-height41,66px))!important;min-height:0!important;overflow:hidden}
 body.signed-in31 #workspace>main{padding:12px 20px!important;min-height:0;height:100%;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}
 body.signed-in31 #page{width:100%;max-width:none!important;margin:0!important;min-height:0;flex:1;overflow:auto;box-sizing:border-box;scrollbar-gutter:stable}
 body.signed-in31>header{height:auto!important;min-height:66px!important;flex-wrap:wrap;gap:10px!important;padding-block:8px!important}
 body.signed-in31 .app-sidebar{top:0!important;height:100dvh!important}
 #module-actions{display:flex;align-items:center;justify-content:flex-end;flex:1;gap:8px;min-width:0;flex-wrap:wrap}
 #module-actions[hidden],#module-actions>[hidden]{display:none!important}
 #module-actions button{min-height:36px;padding:8px 12px;font-size:12px;line-height:1.3;white-space:normal}
 #module-actions svg{width:17px;height:17px;flex-shrink:0}
 #module-actions .parts-switch{display:flex;margin:0;padding:0;gap:4px;flex:1;min-width:350px}
 #module-actions .parts-switch button{min-height:36px;padding:8px 10px;display:flex;align-items:center;gap:6px;font-size:12px;flex:1}
 #module-actions .parts-switch small{display:none}
 #module-actions .parts-switch button{white-space:nowrap}
 body.signed-in31>header.has-module-actions #v-search353{display:none!important}
 body.signed-in31 #page .compact-heading{display:none!important}
 #page>.module-heading41{padding:0!important;margin:0!important;box-shadow:none!important;border:0!important;position:static!important;background:transparent!important}
 #page>.module-heading41>.lifecycle-filter-r6{margin:0 0 10px!important;display:flex;align-items:center;gap:8px}
 #page>.module-heading41>.lifecycle-filter-r6 label{display:flex;align-items:center;gap:8px;margin:0}
 #page>.module-heading41>.lifecycle-filter-r6 select{width:auto;min-width:130px}
 #page .grid-tools{margin:0 0 12px;padding:0;display:flex;align-items:flex-end;gap:10px}
 #page .grid-tools label{margin:0;gap:5px}
 #page .grid-tools button{margin:0;min-height:40px}
 #page .grid-tools>:is(.lifecycle-filter-r6,.compliance-filter-r5){margin:0;flex:0 0 auto;order:2}
 #page .grid-tools>:is(.lifecycle-filter-r6,.compliance-filter-r5) label{margin:0}
 #page .grid-tools>:is(.lifecycle-filter-r6,.compliance-filter-r5) select{min-width:140px}
 #page .list-workspace-ui2{margin-top:0;padding:16px}
 #page .wa-section{padding:16px!important;margin-top:0!important}
 #page .list-tools-ui2{gap:12px;padding-bottom:12px;margin-bottom:12px}
 #page .brigade-grid30{width:100%;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:16px}
 #page .brigade-card30{padding:20px}
 #page .fp-totals32{margin-top:0;gap:12px}
 #page .fp-totals32>div{padding:16px 20px;min-height:90px}
 #page .ops-filters30{margin-top:0;padding:16px;gap:12px}
 #page .ops-filters30>.compact-due{justify-self:start;align-self:center}
 #page #analytics-entry.compact-empty{display:none!important}
 #page #analytics-entry:not(.compact-empty){padding:12px;margin:0 0 12px}
 #page #analytics-entry .an-entry-heading{margin:0}
 #page #analytics-entry .an-entry-heading p{display:none}
 #page .dash-filter{margin:0 0 12px;padding:12px 16px;gap:10px}
 #page .dash-tabbar{margin-block:10px}
 .compact-dashboard-filters{border:0!important;padding:0!important;margin:0!important;background:transparent!important}
 .compact-dashboard-filters>summary{display:none}
 .compact-counting-note{margin:10px 0 12px;padding:10px 14px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-panel);font-size:12px}
 .compact-counting-note summary{cursor:pointer;font-weight:600}
 .compact-counting-note p{line-height:1.6;margin:10px 0 0}
 #page .m-page340{height:100%;min-height:0;padding:0;gap:10px}
 #page .m-review-banner344{margin-block:0 10px}
 #page .home-totals{margin:0 0 12px;gap:12px}
 #page .home-search{margin:0 0 12px;padding:12px 16px;display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
 #page .home-search .v-list-title353{display:none}
 #page .home-search .search-label{order:-1;flex:1;min-width:220px;margin:0}
 #page .home-search .search-input{width:100%}
 #page .home-search .search-input input{padding-left:38px!important;box-sizing:border-box}
 #page .home-search .v-new-case353{margin:0}
 .contextbar{margin:0 0 12px!important;padding:10px 14px!important;flex-shrink:0}
 .contextbar:not(.has-case) .context-title,.contextbar #case-picker>label{display:none!important}
 .contextbar #case-picker{margin:0}
 .contextbar .contextrow{margin:0;align-items:center;gap:8px}
 .contextbar .contextrow input{min-width:120px}
 .contextbar button{min-height:38px}
 #module-actions #m-sync-status340{font-size:11px;max-width:170px;line-height:1.4}
 #header-location{flex:0 1 auto!important;min-width:0}
 #header-location strong{white-space:normal}
 @media(min-width:821px){
  body.experience-compact{--sidebar-width:76px}
  body.signed-in31.experience-compact>header{margin-left:76px!important}
  body.experience-compact .app-sidebar{width:76px!important}
  body.experience-compact .v-brand353{justify-content:center;padding:16px 8px}
  body.experience-compact .v-brand353>div{display:none}
 }
 body[data-page=parts] .contextbar #case-picker>summary{display:list-item!important;cursor:pointer}
 body[data-page=parts] .contextbar #case-picker[open] .contextrow{margin-top:8px}
 :root[data-theme=dark] #page .empty{color:var(--ui-muted)!important}
 @media(max-width:1250px){
  #module-actions{order:10;flex-basis:100%;justify-content:flex-start;border-top:1px solid var(--ui-line,#d2dce8);padding-top:8px}
  body.signed-in31>header .topright{margin-left:auto}
 }
 @media(max-width:820px){
  body.signed-in31 #workspace>main{padding:10px!important}
  body.signed-in31 .app-sidebar{top:0!important;height:100dvh!important}
  #module-actions{gap:6px}
  #module-actions button{min-height:40px}
  #module-actions .parts-switch{flex-basis:100%;min-width:0}
  #module-actions .parts-switch button{font-size:11px;padding:7px}
  .compact-dashboard-filters>summary{display:list-item;padding:12px 14px;cursor:pointer;font-weight:600;background:var(--ui-panel);border:1px solid var(--ui-line);border-radius:10px}
  .compact-dashboard-filters[open]>summary{margin-bottom:10px}
  #module-actions #m-sync-status340{max-width:none}
  .contextbar .contextrow{display:grid;grid-template-columns:1fr auto auto;gap:6px}
  .contextbar .contextrow input{grid-column:1/-1;min-width:0;width:100%}
  .contextbar .contextrow button{padding:7px 10px}
 }
 /* Presentación de estadísticas y papel conservan su título y período. */
 body.dashboard-present #page .dash-hero.compact-heading{display:flex!important}
 body.dashboard-present #workspace.shell{height:100dvh!important}
}

/* Superficies operativas: declarar fondo y texto juntos evita que las reglas
   generales de títulos claros vuelvan ilegibles tarjetas heredadas blancas.
   No se modifica el documento HTML recibido ni las hojas de impresión. */
@media screen {
 :root[data-theme=dark] :is(.dil-context,.dil-form-card,.dil-dialog,.dil-template-box,.dil-mapping,.dil-footer,.m-shell340,.m-content340,.m-heading340,.m-bulk340,.m-folder-column340,.mail-sidebar33,.mail-reader33,.mail-reader-head33,.mail-pages33,.m-searchbar340 form,.m-compose340,.m-compose-heading340,.m-compose-footer340,.m-original340,.m-original344,.m-recipient340,.m-editor-toolbar340,#m-rich-editor340,.m-dropzone340,.m-pending-file340,.m-final-recipient351,.mail-file33,.mail-reply33,.m-sync-detail340,.tracking-owner350,.internal-note40){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
 :root[data-theme=dark] :is(.dil-context,.dil-form-card,.dil-template-box,.dil-mapping,.dil-footer,.dil-field,.mail-reader-head33,.m-heading340,.m-bulk340,.m-folder-column340,.mail-pages33,.m-recipient340,.m-final-recipient351,.m-sync-detail340,.tracking-owner350,.internal-note40,.mail-notice-dialog350) :is(p,strong,b,small,span,h2,h3,label,code){color:var(--ui-ink)!important}
 :root[data-theme=dark] .dil-form-icon{background:#254956!important;color:#b5edf4!important}
 :root[data-theme=dark] .dil-dialog .dil-error{background:#4b2930!important;color:#ffdad5!important;border-color:#a26b75!important}
 :root[data-theme=dark] :is(.m-response-alert344,.m-pending-response344,.m-update340){background:#203f46!important;color:#d4f1f2!important;border-color:#568891!important}
 :root[data-theme=dark] :is(.m-response-alert344,.m-pending-response344,.m-update340) :is(strong,p,span,h3){color:#d4f1f2!important}
 :root[data-theme=dark] .m-row340.mail-row33{background:#202938!important;border-color:#41516a!important;color:#e5edf9!important}
 :root[data-theme=dark] .m-row340.mail-row33.is-read{background:#192230!important}
 :root[data-theme=dark] .m-row340.mail-row33:is(:hover,.selected){background:#304966!important;box-shadow:inset 3px 0 #93c5fd}
 :root[data-theme=dark] .m-row340 .m-message340{background:transparent!important;color:#e5edf9!important}
 :root[data-theme=dark] .m-row340 :is(.m-row-sender340,strong,time,.m-snippet340,.m-row-meta340 small){color:#e5edf9!important}
 :root[data-theme=dark] :is(.m-folder-help344,.m-page-count340,.m-local-note340,.m-label-heading340,.mail-notice-help350,.mail-stage350 p){color:#bdcce0!important}
 :root[data-theme=dark] .m-folders340 button{background:transparent!important;color:#e5edf9!important}
 :root[data-theme=dark] .m-folders340 button:is(:hover,.selected){background:#304966!important;color:#fff!important}
 :root[data-theme=dark] .m-folders340 button b{background:#405673!important;color:#fff!important}
 :root[data-theme=dark] .m-folders340 button.selected b{background:#b9e8ec!important;color:#173c46!important}
 body>header .mail-notifications350 b{background:#e5edf9!important;color:#20354d!important;min-width:24px;padding:3px 7px;line-height:1.3}
 body>header .mail-notifications350.has-new b{background:#c4f1e5!important;color:#173f39!important}
 :root[data-theme=dark] :is(.m-status340,.m-tag340,.mail-import-tag-r10,.m-archive-tag-r9,.compliance-reference-r5){background:#354961!important;color:#edf4ff!important;border-color:#647e9d!important}
 :root[data-theme=dark] .compliance-reference-r5 b{color:#edf4ff!important}
 :root[data-theme=dark] .m-status340:is(.state-PENDING,.state-TODO,.state-WAITING){background:#4c3d22!important;color:#ffe3a8!important;border-color:#9c814c!important}
 :root[data-theme=dark] .m-status340:is(.state-SENT,.state-REVIEWED){background:#24493c!important;color:#c3f4dd!important;border-color:#658d7b!important}
 :root[data-theme=dark] .m-status340:is(.state-CORRECT,.state-ISSUES){background:#522e3a!important;color:#ffdae4!important;border-color:#b08290!important}
 :root[data-theme=dark] .row-more>summary,:root[data-theme=dark] .row-more-items{background:#304158!important;color:#eef4ff!important;border-color:#69809d!important}
 :root[data-theme=dark] .row-more-items :is(button,a){color:#eef4ff!important}
 :root[data-theme=dark] .m-searchbar340 form>svg{color:#c2d2e7!important}
 :root[data-theme=dark] :is(.m-labels340 button,.mail-file33,.mail-reply33) :is(strong,small,span){color:#e5edf9!important}
 :root[data-theme=dark] .m-labels340 button{color:#e5edf9!important}
 :root[data-theme=dark] .m-labels340 button.selected{background:#304966!important}
 .mail-notice-dialog350[open]{display:flex;flex-direction:column;padding:0!important;overflow:hidden;max-height:88dvh}
 .mail-notice-dialog350>.dialoghead{flex-shrink:0;padding:18px 24px!important}
 .mail-notice-dialog350>p{padding:0 24px!important;margin:12px 0;line-height:1.65;flex-shrink:0;overflow-wrap:anywhere}
 .mail-notice-dialog350>.mail-notice-list350{padding:0 24px!important;min-height:0;overflow:auto;flex:1;max-height:44dvh}
 .mail-notice-list350 article{padding:16px 0;gap:20px}
 .mail-notice-list350 article>div{min-width:0;overflow-wrap:anywhere}
 .mail-notice-dialog350>.dialogfoot{position:static!important;margin:0!important;padding:14px 24px!important;flex-shrink:0}
 .mail-notice-dialog350 #mail-notice-error350:empty{display:none}
 .m-response-alert344{padding:16px 20px!important;gap:20px!important;line-height:1.6}
 @media(max-width:650px){.mail-notice-dialog350>.dialoghead,.mail-notice-dialog350>.dialogfoot{padding:16px 18px!important}.mail-notice-dialog350>p,.mail-notice-dialog350>.mail-notice-list350{padding-inline:18px!important}.mail-notice-list350 article{flex-wrap:wrap;gap:10px}.m-response-alert344{padding:14px 16px!important}}
}
@media screen {
 :root[data-theme=dark] [aria-sort] .sort-ui2{color:#bcd8ff!important}
 :root[data-theme=dark] :is(button,a,summary,input,select,textarea):focus-visible{outline:3px solid #afd4ff!important;outline-offset:3px}
}
@media screen {
 :root:not([data-theme=dark]) .m-row340 :is(.m-message340,.m-row-meta340){color:#26374b!important}
 :root:not([data-theme=dark]) .mail-notice-dialog350 .eyebrow{color:#52637b!important}
 :root[data-theme=dark] body>header #mail-notifications350 b{color:#20354d!important;background:#e5edf9!important}
 :root[data-theme=dark] body>header #mail-notifications350.has-new b{color:#173f39!important;background:#c4f1e5!important}
 :root[data-theme=dark] button.danger{background:#522e3a!important;color:#ffdae4!important;border-color:#b08290!important}
 .mail-notice-dialog350[open]{overflow:auto}
 @media(max-height:500px){.mail-notice-dialog350[open]{max-height:96dvh}.mail-notice-dialog350>.mail-notice-list350{flex:none;max-height:none}.mail-notice-dialog350>.dialoghead{position:static}}
}
@media screen {
 :root[data-theme=dark] :is(.m-file-pick340,.mail-receipts-r9,.mail-receipt-r9,.mail-receipt-dialog-head-r9,.mail-receipt-file-picker-r9){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
 :root[data-theme=dark] :is(.m-file-pick340,.mail-receipts-r9,.mail-receipt-r9,.mail-receipt-dialog-head-r9,.mail-receipt-file-picker-r9) :is(p,span,label,strong,small){color:var(--ui-ink)!important}
}
@media screen {
 :root[data-theme=dark] #page .m-folders340 button.selected b{color:#173c46!important;background:#b9e8ec!important}
 :root[data-theme=dark] #page .m-row-meta340 svg{color:#bcd8ff!important}
}

/* Editores: las pestañas son parte fija del formulario, fuera del único cuerpo
   desplazable. No compensar con márgenes sticky: dejan pasar texto por debajo. */
@media screen {
 #editor-form>.editor-tabs{position:static!important;flex:none;margin:0!important;padding:8px 22px!important;border-radius:0!important;background:var(--ui-soft)!important;border-bottom:1px solid var(--ui-line);z-index:2}
 #editor-form:has(>.editor-tabs) .editor-scroll-ui2{padding-top:18px;scroll-padding-top:18px}
 #case-table td.case-agency{display:table-cell!important;-webkit-line-clamp:unset;overflow:visible;vertical-align:top}
 #case-table table{border-collapse:collapse}
 #case-table tbody td{border-bottom:1px solid var(--ui-line)!important}
 @media(min-width:821px){.v-brand353{box-sizing:border-box;min-height:var(--appbar-height41,66px)}}
 :root[data-theme=dark]{--text-primary41:var(--ui-ink);--text-secondary41:var(--ui-muted)}
 :root[data-theme=dark] :is(.attachments,.location,.location.closed,.detail-card){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
 :root[data-theme=dark] :is(.attachments,.location,.detail-card) :is(h3,p,strong,small){color:var(--ui-ink)!important}
 :root[data-theme=dark] .fields :is(dt,dd){color:var(--ui-ink)!important}
 :root[data-theme=dark] .fields>div{border-color:var(--ui-line)!important}
 :root[data-theme=dark] .attachments a{color:#bcd8ff!important}
 :root[data-theme=dark] .fp-state352,:root[data-theme=dark] .fp-state352.active{background:#304966!important;color:#e5edf9!important;border-color:#6485aa!important}
 :root[data-theme=dark] .fp-state352>span{color:inherit!important}
 :root[data-theme=dark] .fp-state352.completed{background:#24493c!important;color:#c3f4dd!important}
 :root[data-theme=dark] .fp-state352.annulled{background:#522e3a!important;color:#ffdae4!important}
}

/* Contraste de ayudas, pestañas y superficies secundarias: cada fondo define su texto. */
@media screen {
 :root:not([data-theme=dark]) :is(.pagination,.custody-subtitle,.dialoghead .eyebrow){color:#526177!important}
 :root:not([data-theme=dark]) #editor-form>.editor-tabs button.secondary{color:#526177!important}
 [data-type-chart] b{color:inherit!important}
 :root:not([data-theme=dark]) .custody-dialog :is(.custody-confirm,#custody-progress,.custody-fields b){color:#526177!important}
 :root:not([data-theme=dark]) .custody-steps button:not(.active){color:#526177!important}
 :root[data-theme=dark] :is(.case-control30,.mail-guide301,.google-account302,.custody-source,.custody-link,.custody-steps,.custody-quiet,#dil-completion){background:var(--ui-panel)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
 :root[data-theme=dark] :is(.mail-guide301,.google-mail302) a{color:#bcd8ff!important}
 :root[data-theme=dark] :is(.dash-map-legend,.dash-map-legend span,.custody-review dd,.custody-confirm,.custody-private,.custody-source summary,.custody-footer>span,#custody-progress,.custody-fields b){color:var(--ui-muted)!important}
 :root[data-theme=dark] .custody-steps button{color:var(--ui-ink)!important}
 :root[data-theme=dark] .custody-steps button.active{background:var(--ui-soft)!important;color:var(--ui-ink)!important}
 :root[data-theme=dark] .custody-steps button span{background:var(--ui-soft)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
}
@media screen {
 :root[data-theme=dark] .custody-steps #custody-progress{color:var(--ui-muted)!important}
 :root:not([data-theme=dark]) .custody-dialog :is(.custody-source summary,.custody-private,#custody-save-state){color:#526177!important}
}
@media screen {
 :root[data-theme=dark] .custody-section-title>span{color:var(--ui-muted)!important}
}

/* Superficies de lectura: texto y fondo cambian juntos, incluidos originales y respuestas. */
@media screen {
 :root{--mail-body-bg:#fff;--mail-body-fg:#202c3c;--mail-body-link:#164d91}
 :root[data-theme=dark]{--mail-body-bg:#212a39;--mail-body-fg:#edf3fc;--mail-body-link:#b9d6ff}
 :is(.mail-text33,.m-rich-preview340,#m-rich-editor340){background:var(--mail-body-bg)!important;color:var(--mail-body-fg)!important;line-height:1.65;overflow-wrap:anywhere;padding:18px 20px;box-sizing:border-box}
 :is(.mail-text33,.m-rich-preview340,#m-rich-editor340) :is(p,div,span,strong,b,em,i,u,li,blockquote){color:inherit!important;background:transparent!important}
 :is(.mail-text33,.m-rich-preview340,#m-rich-editor340) a{color:var(--mail-body-link)!important;text-decoration:underline}
 dialog.ui-managed-dialog>:is(form,p,section,details,.actions,.error,.notice){margin-inline:22px!important;max-width:calc(100% - 44px);box-sizing:border-box}
 dialog.ui-managed-dialog>form{padding-block:18px;display:grid;gap:16px}
 dialog.ui-managed-dialog>p{line-height:1.6;margin-block:16px}
 dialog.ui-managed-dialog>.dialoghead{padding:18px 22px!important}
 .home-search{justify-content:flex-start!important;align-items:end!important;gap:12px!important;flex-wrap:wrap}
 .home-search>.search-label{order:-3!important;flex:0 1 560px!important;min-width:200px;max-width:100%;margin:0!important}
 .home-search>.v-new-case353{order:-2!important;margin:0!important;min-height:40px}
 .home-search>label:not(.search-label){flex:0 1 170px;margin:0!important}
 .home-search>button{min-height:40px;margin:0!important}
 .locales-filters,.map-local-search{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-block:16px}
 .locales-filters>label,.map-local-search>label{flex:1 1 180px;min-width:0}
 .map-local-search>label:first-child{flex-basis:360px}
 .locales-report .tablewrap{max-width:100%;overflow:auto}.locales-report td{vertical-align:top;overflow-wrap:anywhere}
 @media(max-width:650px){.home-search>.search-label{flex-basis:100%!important}dialog.ui-managed-dialog>:is(form,p,section,details,.actions,.error,.notice){margin-inline:16px!important;max-width:calc(100% - 32px)}}
}

@media screen { :root[data-theme=dark] :is(#m-draft-status340,.m-review-hint340,.m-recipient340 small,.m-recipient340 svg){color:var(--ui-muted)!important} }

/* Acciones de consulta en su propia fila, debajo de todos los filtros. */
.locales-report .locales-filter-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:12px;margin:0 0 16px;width:100%}
.locales-report .locales-filter-actions>button{flex:0 0 auto;min-height:40px;max-width:100%}
