/* EZAccounting 0.3.12.9 — Mobile layout cleanup.
 * Only the server-rendered shortcode application shell; never affects
 * desktop, WordPress admin, document print pages or the mobile nav component.
 * Keeps layout/permissions/financial forms and existing actions untouched.
 */
@media screen and (max-width: 767px) {
  .ezacc.ezacc-shell-v0380 {
    --ezacc-mobile-gutter: 12px;
    --ezacc-mobile-card-padding: 12px;
    --ezacc-mobile-gap: 12px;
  }
  body .ezacc.ezacc-pro.ezacc-wave-shell.ezacc-shell-v0380 > .ezacc-shell-main-v0380 {
    padding: 12px var(--ezacc-mobile-gutter) calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    background: #f7f9fb !important;
    overflow-x: clip;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380,
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 > :not(style):not(script),
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(section,article,form,fieldset,details) {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Use one shared visual language for the outer content surfaces, not their
     data-entry rows, inline notices or nested accounting tables. */
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-card, .ezacc-im-register, .ezacc-report-intro, .ezacc-report-panel,
    .ezacc-report-result, .ezacc-bank-panel-v03126, .ezacc-insight-panel,
    .ezacc-pws-panel, .ezacc-pws-editor, .ezacc-pws-disclosure
  ) {
    border-radius: 12px !important;
    border-color: #e3e9ef !important;
    box-shadow: 0 1px 4px rgba(22, 39, 60, .03) !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-card, .ezacc-im-register, .ezacc-report-intro, .ezacc-report-panel,
    .ezacc-report-result, .ezacc-bank-panel-v03126, .ezacc-insight-panel,
    .ezacc-pws-panel, .ezacc-pws-editor, .ezacc-pws-disclosure
  ) { padding: var(--ezacc-mobile-card-padding) !important; }
  /* Listing workspaces already contain their own record cards. Remove the
     extra outside frame on phones: one surface per useful content layer. */
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 .ezacc-im-register,
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 .ezacc-card.ezacc-pws-panel,
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 .ezacc-aw-content > .ezacc-card {
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-bank-panel-v03126 > .ezacc-bank-account-row-v03126 {
    border: 0 !important;
    background: #f5f8fa;
  }
  /* Eliminate double-framed cards where a module already supplies its own
     content frame; keep distinct warning / error / confirmation borders. */
  .ezacc.ezacc-shell-v0380 .ezacc-aw-content > .ezacc-card > .ezacc-card,
  .ezacc.ezacc-shell-v0380 .ezacc-im-register > .ezacc-card {
    border: 0 !important;
    border-radius: 9px !important;
    box-shadow: none !important;
    background: #f7fafb !important;
    padding: 10px !important;
    margin: 8px 0 !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-report-panel > .ezacc-report-result {
    border: 0 !important;
    background: #f5f8fa !important;
    box-shadow: none !important;
    padding: 10px !important;
  }
  /* Prevent large accumulated bottom spacers: the shell already clears the
     fixed bottom nav and mobile safe area. */
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-insights-v03127, .ezacc-pws, .ezacc-banking-v03126,
    .ezacc-dashboard-v0310, .ezacc-aw-content, .ezacc-section-panel-v0312,
    .ezacc-im-pagination
  ) { padding-bottom: 0 !important; }
  /* Compact page headings, tabs, summaries and list spacing. */
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-pws-heading, .ezacc-bank-heading-v03126, .ezacc-insight-heading,
    .ezacc-im-register-head, .ezacc-aw-section-head
  ) { gap: 9px !important; margin-bottom: 12px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-pws-heading h2, .ezacc-bank-heading-v03126 h2,
    .ezacc-insight-heading h2, .ezacc-aw-section-head h2
  ) { font-size: 20px !important; line-height: 1.27 !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-workspace-tabs-v0312, .ezacc-aw-tabs, .ezacc-pws-tabs,
    .ezacc-im-sections, .ezacc-insight-tabs, .ezacc-im-status-tabs,
    .ezacc-bank-tabs-v03126
  ) {
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 4px !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    padding-bottom: 5px !important;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-workspace-tab-v0312, .ezacc-aw-tab, .ezacc-pws-tabs a,
    .ezacc-im-sections a, .ezacc-insight-tab
  ) { min-height: 42px; padding: 9px 11px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-report-kpis, .ezacc-im-kpis, .ezacc-pws-summary,
    .ezacc-bank-kpis-v03126, .ezacc-insight-kpis, .ezacc-aw-kpis
  ) { gap: 8px !important; margin-bottom: 12px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-im-kpi, .ezacc-pws-kpi, .ezacc-bank-kpi-v03126,
    .ezacc-insight-kpi, .ezacc-aw-kpi, .ezacc-report-kpis > div
  ) {
    padding: 11px !important;
    gap: 5px !important;
    border-radius: 11px !important;
    box-shadow: none !important;
    min-width: 0 !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-report-kpis { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-report-kpis > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ezacc.ezacc-shell-v0380 .ezacc-pws-summary {grid-template-columns: repeat(2, minmax(0, 1fr)) !important;}
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-im-kpi strong, .ezacc-pws-kpi strong, .ezacc-bank-kpi-v03126 strong,
    .ezacc-insight-kpi strong, .ezacc-aw-kpi strong, .ezacc-report-kpis strong
  ) { font-size: clamp(15px, 4.2vw, 19px) !important; overflow-wrap: anywhere !important; }
  /* Form editors: avoid oversized inner padding without removing form labels. */
  .ezacc.ezacc-shell-v0380 .ezacc-contact-editor,
  .ezacc.ezacc-shell-v0380 .ezacc-quote-form-v03111,
  .ezacc.ezacc-shell-v0380 .ezacc-aw-editor {
    padding: 12px !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 .ezacc-aw-journal-tools button.ezacc-aw-add-line {
    background: #e9f5f0 !important;
    border: 1px solid #bcded2 !important;
    color: #076651 !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 .ezacc-aw-journal-tools button.ezacc-aw-remove-line {
    background: #fff !important;
    border: 1px solid #e8ccd0 !important;
    color: #a03c4d !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-im-mobile-list { gap: 8px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-im-mobile-card,
  .ezacc.ezacc-shell-v0380 .ezacc-pws-record,
  .ezacc.ezacc-shell-v0380 .ezacc-contact-item,
  .ezacc.ezacc-shell-v0380 .ezacc-bank-account-row-v03126 {
    padding: 11px !important;
    border-color: #e5ebf0 !important;
    box-shadow: none !important;
    border-radius: 10px !important;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-pws-panel, .ezacc-pws-editor, .ezacc-bank-panel-v03126,
    .ezacc-aw-content > .ezacc-card, .ezacc-insight-panel
  ) { margin-bottom: 12px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-pws-filter, .ezacc-im-filters, .ezacc-aw-filters,
    .ezacc-report-filters, .ezacc-bank-search-v03126
  ) { gap: 9px !important; margin-bottom: 12px !important; }
  /* Consistent compact 44px touch controls and no iOS input-focus zoom.
     Exclude checkboxes/radios/file controls, where native sizing is important. */
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
    select, textarea
  ) {
    max-width: 100%;
    min-width: 0;
    min-height: 44px !important;
    font-size: 16px !important;
    border-radius: 9px;
    box-sizing: border-box;
  }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    button, input[type="submit"], input[type="button"]
  ) { min-height: 42px; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-aw-table-wrap, .ezacc-report-scroll, .ezacc-scroll,
    .ezacc-im-table-wrap, .ezacc-insight-table-scroll,
    .ezacc-pws-desktop, .ezacc-bank-table-wrap-v03126
  ) { max-width: 100% !important; min-width: 0 !important; overflow-x: auto; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-aw-content, .ezacc-insights-v03127, .ezacc-pws,
    .ezacc-banking-v03126, .ezacc-invoices, .ezacc-reports
  ) > :first-child { margin-top: 0 !important; }
}
@media screen and (max-width: 359px) {
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-im-kpi, .ezacc-pws-kpi, .ezacc-bank-kpi-v03126,
    .ezacc-insight-kpi, .ezacc-aw-kpi
  ) { padding: 9px !important; }
  .ezacc.ezacc-shell-v0380 .ezacc-shell-main-v0380 :is(
    .ezacc-im-primary, .ezacc-pws-primary, .ezacc-bank-cta-v03126
  ) { max-width: 100%; white-space: normal; text-align: center; }
}

@media screen and (max-width: 359px) {
  .ezacc.ezacc-shell-v0380 { --ezacc-mobile-gutter: 10px; --ezacc-mobile-card-padding: 11px; }
}
