/* One spacing policy for every top-bar module. Only geometry is adapted:
   native Quantix colors, type, proofs, writers, document previews and dialogs retain their owners.
   Explicit adapters avoid shrinking touch controls or changing global spacing tokens. */

/* Facturas: remove nested toolbar/scroller padding without changing the financial grid. */
@media(min-width:821px) {
 html[data-face="workbench"] body.cc-embed section.lux-grid-card { padding:4px 8px 8px; }
 /* cfdi_v3 pins its toolbar padding with !important; override that property only. */
 html[data-face="workbench"] body.cc-embed section.lux-grid-card > .lux-grid-toolbar { padding:4px 8px!important; min-height:0!important; }
 html[data-face="workbench"] body.cc-embed .lux-grid-scroller > .v3-frow { margin-block:4px; }
 html[data-face="workbench"] body.cc-embed .lux-grid-scroller > .v3-hint { margin-bottom:4px; padding-block:4px; }
 html[data-face="workbench"] body.cc-embed .lux-grid-footer { padding-block:4px; }
}

/* Bancos: the navigation, account rail and ledger form one compact workspace. */
html body.banco-modern.is-cc .banco-wrap { padding-inline:10px; }
html body.banco-modern .banco-workbar { padding:6px 12px; margin-inline:-10px; gap:6px 8px; }
html body.banco-modern .banco-workbar__account { margin:0; padding-top:4px; }
html body.banco-modern .banco-content-frame { padding-top:0; }
html body.banco-modern .bw-heading { padding:8px 0; gap:8px; }
html body.banco-modern .bw-heading h1 { margin-bottom:4px; }
html body.banco-modern .bw-tools { margin-bottom:8px; padding:6px 8px; gap:8px; }
@media(min-width:821px) {
 html body.banco-modern .banco-workbar > .bw-nav { margin:0; gap:8px; }
 html body.banco-modern .bw-nav > a { min-height:34px; padding-block:6px; }
 html body.banco-modern .bw-columns,
 html body.banco-modern .bw-row { padding:8px 10px; }
 html body.banco-modern .bw-row { min-height:0; }
}

/* Contabilidad: retain the compact shared-workspace correction in the common policy. */
html body[data-contabilidad] .conta-live-workspace { gap:var(--lux-sp-2, 8px); }
html body[data-contabilidad] .conta-live-workspace > :is(section, aside, details, .conta-commandbar) { margin-block:0; }

/* Cierre Fiscal: use the full shell width; one gap between sections, never gap + card margin. */
html[data-quantix-layout="workbench"] body.cc-embed main.tax-wrap {
 width:100%; max-width:none; margin:0; padding:8px 10px 16px; box-sizing:border-box;
}
html body.cc-embed .vx-bilateral-workspace { gap:8px; }
html body.cc-embed .vx-flight-deck-main { gap:8px; }
html body.cc-embed .vx-flight-deck-main > :is(section, article, aside, details, .tax-card) { margin-block:0; }
html body.cc-embed .tax-wrap > .fiscal-bridge-bar { margin-block:0 8px; padding:6px 10px; }
html body.cc-embed .tax-wrap > .workspace-proof { margin-block:4px; }
@media(min-width:821px) {
 html[data-quantix-layout="workbench"] body.cc-embed main.tax-wrap > .tax-workbar { padding:4px 8px; }
 html[data-quantix-layout="workbench"] body.cc-embed main.tax-wrap .tax-card { padding:10px 12px; }
}

/* Recorrido: compact the page chrome and cards, with the same evidence and actions. */
html body.journey #jr-main { padding:0 10px 16px; }
html body.journey .jr-nav { padding-block:6px; gap:8px; }
html body.journey .jr-head { margin:8px 0; gap:8px; }
html body.journey .jr-months,
html body.journey .jr-stats { gap:8px; margin-bottom:8px; }
html body.journey :is(.jr-overview, .jr-six, .jr-decisions) { gap:8px; }
html body.journey .jr-card { padding:12px; }
html body.journey .jr-card h2,
html body.journey .jr-card-top { margin-bottom:8px; }
html body.journey .jr-footer { margin-top:8px; }
@media(min-width:821px) {
 html body.journey .jr-month { min-height:0; padding:10px; }
 html body.journey .jr-stat { padding:8px 10px; }
 html body.journey .jr-six .jr-card { min-height:0; }
}

/* Mesa: reduce the crown and section gaps while retaining the existing desk components. */
html body.es .es-main { padding:8px 10px; }
html body.es .es-top { height:44px; padding-inline:10px; }
html body.es .es-crown { padding:12px 14px; }
html body.es .es-crown__grid { grid-template-columns:100px minmax(0,1fr); margin-top:8px; gap:12px; }
html body.es .es-crown .es-dial,
html body.es .es-crown .es-dial > svg { width:100px; height:100px; }
html body.es .es-crown__split { margin-top:8px; padding-top:8px; gap:16px; }
html body.es .es-crown__meta { margin-top:6px; }
html body.es .es-sec { margin-top:8px; padding-bottom:6px; }
html body.es .es-it { padding:8px 10px; }
/* Mesa's phone destination is Bolsillo. Keep its fixed safe areas and touch sizes. */
html body.bq .bq-sec { padding:8px 12px; gap:8px; }
html body.bq .bq-it { padding-block:8px; }

/* Office: compact the editing chrome, not the report's printable page geometry. */
body #filemon-office-studio .fo-titlebar { padding:8px 12px; gap:8px; }
body #filemon-office-studio .fo-tabs { padding-inline:12px; gap:16px; }
body #filemon-office-studio .fo-toolbar { padding:6px 10px; gap:8px; }
body #filemon-office-studio .fo-layout { min-height:0; }
body #filemon-office-studio .fo-document-layout { padding:10px; gap:8px; }
body #filemon-office-studio .fo-assistant { margin:0 10px 8px; padding:8px 10px; gap:8px; }
body #filemon-office-studio .fo-statusbar { padding:6px 10px; }
@media(max-width:820px) {
 html body.banco-modern .banco-workbar { padding:6px 10px; }
 html body.banco-modern .bw-heading { padding-block:8px; }
 html body.cc-embed main.tax-wrap { padding:8px 10px 16px; }
 html body.cc-embed .tax-wrap > .fiscal-bridge-bar {
   display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; align-items:start;
 }
 html body.cc-embed .fiscal-bridge-bar > .bridge-item { min-width:0; flex-wrap:wrap; gap:4px; }
 html body.cc-embed .fiscal-bridge-bar > .bridge-item:first-child,
 html body.cc-embed .fiscal-bridge-bar > .bridge-item:last-child { grid-column:1/-1; }
 html body.cc-embed .fiscal-bridge-bar > .bridge-item:last-child { justify-content:flex-start; }
 html body.cc-embed .fiscal-bridge-bar .bridge-item > :is(button,a) { min-height:44px; }
 html body.journey .jr-card { padding:10px; }
 /* Existing controls retain >=44px hit targets; only their surrounding space shrinks. */
 body #filemon-office-studio .fo-titlebar { min-height:0; }
}
