/* Ham-Melk v185 · mobile-first shell and reusable components.
   The old cascade is retained in reproducible compatibility bundles.
   This sheet is screen-only. No data, validation, permissions or print geometry. */
@media screen {
  body.hm185-app {
    --ui-bg:#f3f6fa; --ui-surface:#fff; --ui-ink:#18283f; --ui-muted:#576780;
    --ui-line:#dce4ee; --ui-primary:#2458b8; --ui-primary-soft:#edf3ff;
    --ui-good:#18715b; --ui-danger:#aa3043; --ui-radius:16px; --ui-control:48px;
    --ui-shadow:0 2px 8px rgb(22 45 80 / 4%); --ui-dock:74px;
    --hm-ui-text:var(--ui-ink); --hm-ui-muted:var(--ui-muted); --hm-ui-accent:var(--ui-primary);
    --hm-ui-accent-soft:var(--ui-primary-soft); --hm-ui-control-height:var(--ui-control);
    --hm-ui-radius:var(--ui-radius); --hm-ui-border:var(--ui-line);
    --app-font-family:var(--hm186-font-body,"Yekan","B Yekan",Tahoma,sans-serif);
    color:var(--ui-ink); background:var(--ui-bg)!important; font-family:var(--app-font-family)!important;
    text-size-adjust:100%; -webkit-text-size-adjust:100%; -webkit-tap-highlight-color:transparent;
  }
  body.hm185-app .app-shell {background:var(--ui-bg)!important;min-width:0}
  body.hm185-app .app-shell .workspace {min-width:0}
  body.hm185-app .app-shell .page-content {
    width:100%;max-width:1500px;min-width:0;margin-inline:auto;
    padding:16px 12px calc(var(--ui-dock) + 24px + env(safe-area-inset-bottom,0px))!important;
    color:var(--ui-ink);font-size:max(15px,calc(15px * var(--ds-body-scale,1)));line-height:1.8;
  }
  body.hm185-app .page-content:focus{outline:none}
  body.hm185-app .app-shell :is(button,input,select,textarea){font-family:var(--hm186-font-body)!important}
  body.hm185-app .app-shell :is(h1,h2,h3,h4,h5,h6){font-family:var(--hm186-font-title)!important}
  body.hm185-app .app-shell .page-content :is(.page-heading,.report-page-head,.acct-v48-head,.settings-hero,.smart-accounting-head-v52,.message-center-head) {
    background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;
    padding:0 0 16px!important;margin:0 0 16px!important;gap:12px!important;min-width:0;
  }
  body.hm185-app .app-shell .page-content :is(.page-heading,.report-page-head,.acct-v48-head,.settings-hero,.smart-accounting-head-v52,.message-center-head) h1 {
    font-size:max(21px,calc(22px * var(--ds-title-scale,1)))!important;font-weight:800!important;
    letter-spacing:0;line-height:1.6!important;margin:2px 0 4px!important;color:var(--ui-ink)!important;
  }
  body.hm185-app .app-shell .page-content :is(.page-heading,.report-page-head,.acct-v48-head,.settings-hero,.smart-accounting-head-v52,.message-center-head) p {
    font-size:max(13px,calc(13px * var(--ds-meta-scale,1)))!important;font-weight:400!important;
    color:var(--ui-muted)!important;line-height:1.9!important;margin:0!important;overflow-wrap:anywhere;
  }
  body.hm185-app .app-shell .page-content .eyebrow {font-size:12px!important;line-height:1.6;color:var(--ui-primary);font-weight:600}
  body.hm185-app .app-shell .page-content :is(.panel,.settings-section-card,.report-list-panel,.owner-card-v26,.user-card-v26,.bank-card,.acct-v48-chart-card,.acct-v48-report-panel,.settings-clean-group,.section-hub-card,.history-record) {
    background:var(--ui-surface);border:1px solid var(--ui-line)!important;border-radius:var(--ui-radius)!important;
    box-shadow:var(--ui-shadow)!important;min-width:0;max-width:100%;
  }
  body.hm185-app .app-shell .page-content :is(.panel,.settings-section-card,.acct-v48-chart-card,.acct-v48-report-panel,.settings-clean-group){padding:16px!important;margin-block-end:16px}
  body.hm185-app .app-shell .page-content :is(.panel-head,.settings-section-head,.section-title){gap:12px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid #edf1f6;min-width:0}
  body.hm185-app .app-shell .page-content :is(.panel-head h2,.settings-section-head h2,.section-title b,.settings-clean-group h2){font-size:max(17px,calc(17px * var(--ds-title-scale,1)))!important;line-height:1.7!important;font-weight:750!important}
  body.hm185-app .app-shell .page-content :is(.panel-head p,.settings-section-head p,.section-title span){font-size:max(13px,calc(13px * var(--ds-meta-scale,1)))!important;font-weight:400!important;color:var(--ui-muted);line-height:1.8}
  body.hm185-app .app-shell :is(.button,button.button){
    min-height:var(--ui-control)!important;min-width:0;max-width:100%;padding:10px 16px!important;
    border-radius:12px!important;box-shadow:none!important;
    font-size:max(14px,calc(14px * var(--ds-body-scale,1)))!important;font-weight:650!important;
    line-height:1.65!important;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation;
    transition:background-color .14s,border-color .14s;
  }
  body.hm185-app .app-shell :is(.button.primary,button.primary){background:var(--ui-primary)!important;border-color:var(--ui-primary)!important;color:#fff!important}
  body.hm185-app .app-shell :is(.button.secondary,button.secondary){background:#fff!important;border:1px solid #cbd7e6!important;color:#314966!important}
  body.hm185-app .app-shell .button:disabled {opacity:.55;cursor:not-allowed}
  body.hm185-app :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid #4381de!important;outline-offset:3px}
  body.hm185-app .app-shell .page-content :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),select:not(.ds-native-select),textarea,.ds-select-trigger){
    border-color:#c7d4e4!important;border-radius:11px!important;color:var(--ui-ink);background-color:#fff;
    font-size:max(16px,calc(16px * var(--ds-body-scale,1)))!important;line-height:1.6!important;
    min-width:0;max-width:100%;box-shadow:none!important;
  }
  body.hm185-app .app-shell .page-content :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]),select:not(.ds-native-select),.ds-select-trigger){min-height:48px}
  body.hm185-app .app-shell .page-content input[type=file]{width:100%;padding:8px;font-size:14px!important}
  body.hm185-app .app-shell .page-content textarea{min-height:110px;resize:vertical}
  body.hm185-app .app-shell .page-content input::placeholder,body.hm185-app .app-shell .page-content textarea::placeholder{color:#78869a;opacity:1}
  body.hm185-app .app-shell .page-content :is(.form-grid,.hm-ui-fields,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.account-field-grid,.smart-entry-grid-v52){gap:14px!important;min-width:0}
  body.hm185-app .app-shell .page-content :is(.form-grid,.hm-ui-fields,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.account-field-grid,.smart-entry-grid-v52)>*{min-width:0;max-width:100%}
  body.hm185-app .app-shell .page-content :is(.form-grid,.hm-ui-fields,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.account-field-grid,.smart-entry-grid-v52) label {font-size:max(14px,calc(14px * var(--ds-body-scale,1)))!important;line-height:1.7;font-weight:600!important}
  body.hm185-app .app-shell .page-content :is(.money,.amount,.account-balance,.charge-account-row-v46 strong){font-variant-numeric:tabular-nums}
  body.hm185-app .app-shell .page-content :is(.table-wrap,.acct-v48-table-wrap,.sb84-table-wrap,[data-ui-table]){min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
  body.hm185-app .app-shell .page-content :is(.acct-v48-table,.table-wrap table) th{background:#f3f6fb;color:#455873;font-weight:700!important}
  body.hm185-app .app-shell .page-content .acct-v48-table :is(th,td){padding:14px 12px;font-size:max(14px,calc(14px * var(--ds-body-scale,1)))!important}
  body.hm185-app .app-shell .page-content .acct-v48-table tbody tr:nth-child(even){background:#fafbfd}
  body.hm185-app .hm185-table-hint{display:none;color:var(--ui-muted);font-size:12px;margin:0;padding:8px 0;text-align:start}
  body.hm185-app .hm185-table-hint.is-needed{display:block}
  body.hm185-app .app-shell .page-content :is(.report-tabs,.acct-v48-tabs,.smart-accounting-tabs-v52,.charge-filter-v46,.calendar-view-tabs,.message-filter){
    display:flex!important;gap:6px!important;overflow-x:auto;max-width:100%;min-width:0;flex-wrap:nowrap!important;
    padding:5px!important;background:#eaf0f7;border-radius:13px;border:0;scrollbar-width:thin;overscroll-behavior-x:contain;
  }
  body.hm185-app .app-shell .page-content :is(.report-tabs,.acct-v48-tabs,.smart-accounting-tabs-v52,.charge-filter-v46,.calendar-view-tabs,.message-filter)>:is(a,button){
    flex:0 0 auto;width:auto!important;min-height:48px!important;display:flex;align-items:center;justify-content:center;gap:6px;
    padding:9px 13px!important;border:0!important;border-radius:10px!important;font-size:14px!important;font-weight:600!important;color:#4b5c74;white-space:nowrap;
  }
  body.hm185-app .app-shell .page-content :is(.report-tabs,.acct-v48-tabs,.smart-accounting-tabs-v52,.charge-filter-v46,.calendar-view-tabs,.message-filter)>.active{background:#fff!important;color:var(--ui-primary)!important;box-shadow:0 1px 4px #203f6a0d!important}
  body.hm185-app .app-shell .page-content .hm185-filter{padding:0!important;margin:0 0 16px!important;border:1px solid var(--ui-line)!important;border-radius:14px;background:#fff;box-shadow:none;min-width:0;max-width:100%}
  body.hm185-app .app-shell .page-content .hm185-filter>summary{padding:12px 14px;min-height:52px;cursor:pointer;list-style:none;display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:14px;font-weight:650}
  body.hm185-app .hm185-filter>summary::-webkit-details-marker{display:none}
  body.hm185-app .hm185-filter>summary::after{content:'⌄';margin-inline-start:auto;font-size:20px;line-height:1;color:var(--ui-primary)}
  body.hm185-app .hm185-filter[open]>summary::after{content:'⌃'}
  body.hm185-app .hm185-filter>summary small{font-size:12px;font-weight:400;color:var(--ui-muted);overflow-wrap:anywhere}
  body.hm185-app .app-shell .page-content .hm185-filter>form{margin:0!important;padding:14px!important;border:0!important;border-top:1px solid var(--ui-line)!important;background:transparent!important;box-shadow:none!important;border-radius:0!important}
  body.hm185-app .app-shell .page-content .hm185-filter:not([open])>form{display:none!important}
  body.hm185-app .app-shell .page-content .hm185-filter[open]>.report-filters{display:grid!important}
  body.hm185-app .app-shell .page-content .empty-state{background:#f8fafd;border:1px dashed #cdd8e6;border-radius:14px;padding:26px 16px!important;font-weight:400!important;color:var(--ui-muted);line-height:1.9}
  body.hm185-app .app-shell .page-content .empty-state b{color:var(--ui-ink);font-weight:700}
  body.hm185-app .hm185-js-only{display:none}
  body.hm185-app.hm185-ready .hm185-js-only{display:flex}
  body.hm185-app [data-ui-hidden],body.hm185-app [hidden]{display:none!important}
  /* Fixed touch navigation and a quiet, single-height header. */
  body.hm185-app .app-shell .topbar.hm-header-v182{background:#fff!important;border-bottom:1px solid var(--ui-line);box-shadow:none!important;min-height:64px}
  body.hm185-app .app-shell .hm-header-v182 .topbar-title>b{font-size:15px!important;color:var(--ui-ink)!important;font-weight:750!important}
  body.hm185-app .app-shell .hm-header-v182 .topbar-meta small{font-size:11px!important;font-weight:400!important;color:var(--ui-muted)}
  body.hm185-app .app-shell .hm-header-v182 .icon-button {width:44px!important;height:44px!important;min-width:44px!important;border-radius:12px!important;background:#f5f8fc;flex-basis:44px}
  body.hm185-app .app-shell .hm-header-v182 .small-avatar{width:40px;height:40px;border-radius:12px}
  body.hm185-app .app-shell .hm-header-v182 .topbar-actions{gap:6px!important}
  body.hm185-app .mobile-dock {
    height:calc(var(--ui-dock) + env(safe-area-inset-bottom,0px))!important;
    padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px))!important;
    background:#fff!important;border-top:1px solid var(--ui-line)!important;box-shadow:0 -4px 20px #20324a08!important;
    border-radius:0!important;backdrop-filter:none!important;gap:4px;left:0!important;right:0!important;bottom:0!important;
  }
  body.hm185-app .mobile-dock :is(a,button){min-height:58px!important;border-radius:13px!important;padding:6px 2px!important;gap:4px;font-size:11px!important;font-weight:600!important;color:#5b6d86}
  body.hm185-app .mobile-dock .icon{width:22px;height:22px}
  body.hm185-app .mobile-dock .active{background:var(--ui-primary-soft)!important;color:var(--ui-primary)!important}
  body.hm185-app .sidebar{background:#fff!important;border-color:var(--ui-line)!important;box-shadow:none!important}
  body.hm185-app .sidebar .sidebar-nav a{min-height:48px!important;border-radius:12px!important;margin-bottom:4px;padding:10px 12px!important;font-size:14px!important;color:#435774;font-weight:600!important}
  body.hm185-app .sidebar .sidebar-nav a.active{background:var(--ui-primary-soft)!important;color:var(--ui-primary)!important;border:0!important;box-shadow:inset -3px 0 var(--ui-primary)!important}
  body.hm185-app .sidebar :is(.brand,.sidebar-property,.sidebar-footer){border-color:var(--ui-line)}
  body.hm185-app .sidebar .brand{gap:8px;padding:10px 12px!important;min-height:70px}
  body.hm185-app .sidebar .brand-copy{min-width:0}
  body.hm185-app .sidebar .brand-copy strong{font-size:17px!important}
  body.hm185-app .sidebar .brand-copy span{font-size:11px!important}
  body.hm185-app .sidebar .suite-overview{padding:12px!important;margin:10px 12px!important;border-radius:13px!important;background:#f8fafd}
  body.hm185-app .sidebar .sidebar-nav{padding-inline:12px!important}
  body.hm185-app .hm185-nav-search{flex-direction:column;padding:0 12px 10px;gap:5px}
  body.hm185-app .hm185-nav-search label{font-size:12px;color:var(--ui-muted)}
  body.hm185-app :is(.hm185-nav-search,.hm185-settings-search)>div{display:flex;min-width:0;position:relative;gap:4px}
  body.hm185-app :is(.hm185-nav-search,.hm185-settings-search) input{width:100%;min-width:0;min-height:48px;border:1px solid #c7d4e4;border-radius:11px;background:#fff;font-size:16px;padding:9px 12px 9px 42px;font-family:inherit}
  body.hm185-app :is(.hm185-nav-search,.hm185-settings-search) button{position:absolute;inset-inline-end:2px;top:2px;width:44px;height:44px;background:transparent;border:0;color:#5b6b81;font-size:23px;cursor:pointer}
  body.hm185-app .hm185-nav-search small{font-size:12px;padding:8px}
  body.hm185-app .sidebar .logout-link{min-height:48px}
  body.hm185-app :is(.hm182-close,.modal-close,.dm-iconbtn){min-width:44px!important;min-height:44px!important;touch-action:manipulation}
  body.hm185-app.hm185-modal-open{overflow:hidden;overscroll-behavior:none}
  body.hm185-app [data-ui-modal] [role=dialog]{overscroll-behavior:contain;outline:none}
  body.hm185-app .hm185-view-switch{background:#eef2f8;border-radius:11px;padding:4px;gap:4px}
  body.hm185-app .hm185-view-switch button{border:0;min-height:44px;padding:7px 16px;background:transparent;border-radius:8px;font:inherit;font-size:13px;color:#50637d;cursor:pointer}
  body.hm185-app .hm185-view-switch button[aria-pressed=true]{background:#fff;color:var(--ui-primary);box-shadow:0 1px 4px #233e5c0d}
  body.hm185-app .toast-stack{max-width:min(420px,calc(100vw - 24px))!important;top:78px;left:12px}
  body.hm185-app .ds-toast{border-radius:14px!important;box-shadow:0 8px 26px #26395115!important}
  body.hm185-app .ds-toast [data-toast-close]{min-width:44px;min-height:44px}
}
@media screen and (max-width:900px){
  body.hm185-app .app-shell .workspace{margin-right:0!important;width:100%!important;max-width:100%!important}
  body.hm185-app .sidebar{width:min(350px,90vw)!important;max-width:90vw!important;padding-top:env(safe-area-inset-top,0px)!important}
  body.hm185-app .hm185-sidebar-toggle{display:none!important}
  body.hm185-app .app-shell .page-content :is(.page-heading,.acct-v48-head,.settings-hero,.smart-accounting-head-v52){display:flex!important;flex-direction:column;align-items:stretch!important}
  body.hm185-app .app-shell .page-content :is(.page-heading,.acct-v48-head,.settings-hero,.smart-accounting-head-v52)>div{min-width:0;max-width:100%}
  body.hm185-app .app-shell .page-content :is(.page-heading .actions,.acct-v48-actions,.bank-heading-actions,.settings-detail-actions){display:flex!important;flex-wrap:wrap!important;gap:8px!important;justify-content:flex-start}
  body.hm185-app .app-shell .page-content :is(.form-grid,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.smart-entry-grid-v52,.account-field-grid){grid-template-columns:minmax(0,1fr)!important}
  body.hm185-app .app-shell .page-content :is(.form-grid,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.account-field-grid)>.span-3{grid-column:1/-1!important}
  body.hm185-app .owner-modal.open{padding:0!important;align-items:stretch!important}
  body.hm185-app .owner-modal .owner-modal-card{position:fixed;inset:0;margin:0!important;width:100%!important;max-width:100%!important;height:var(--hm185-vh,100dvh)!important;max-height:var(--hm185-vh,100dvh)!important;border-radius:0!important;display:flex;flex-direction:column;overflow:auto!important;padding-bottom:env(safe-area-inset-bottom,0px)}
  body.hm185-app .owner-modal .owner-modal-card>header{position:sticky;top:0;z-index:4;background:#fff;padding:12px 16px!important;border-bottom:1px solid var(--ui-line);flex:0 0 auto}
  body.hm185-app .owner-modal #newOwnerForm{min-height:0;flex:1;overflow-y:auto;padding:14px!important}
  body.hm185-app .owner-modal .owner-wizard-actions{position:sticky;bottom:0;background:#fff;z-index:3;border-top:1px solid var(--ui-line);padding:12px 0 calc(8px + env(safe-area-inset-bottom,0px))!important}
  body.hm185-app :is(.bank-dialog,.bank-dialog-modern)[open]{max-width:calc(100vw - 16px)!important;max-height:calc(var(--hm185-vh,100dvh) - 16px)!important;border-radius:16px!important}
  body.hm185-app .app-shell .page-content :is(input,textarea,select,button){scroll-margin-block:90px}
  body.hm185-app.hm157-form-focus .app-shell .page-content{padding-bottom:28px!important}
  body.hm185-app.hm185-keyboard .mobile-dock{display:none!important}
}
@media screen and (max-width:520px){
  body.hm185-app .app-shell .topbar.hm-header-v182{gap:6px!important;padding-inline:8px!important}
  body.hm185-app .app-shell .hm-header-v182 .topbar-actions .small-avatar{display:none!important}
  body.hm185-app .app-shell .hm-header-v182 .topbar-title{max-width:none;flex:1 1 auto}
  body.hm185-app .app-shell .hm-header-v182 .menu-button{flex-basis:44px!important}
  body.hm185-app .hm182-dialog{top:72px!important;max-height:calc(var(--hm185-vh,100dvh) - 84px)!important}
  body.hm185-app .app-shell .page-content .button{padding-inline:12px!important}
}
@media screen and (min-width:601px){
  body.hm185-app .app-shell .page-content{padding-inline:24px!important}
}
@media screen and (min-width:901px){
  body.hm185-app{--ui-control:44px;--ui-dock:0px}
  body.hm185-app .app-shell .workspace{margin-right:268px!important;width:calc(100% - 268px)!important;max-width:calc(100% - 268px)!important}
  body.hm185-app .sidebar{width:268px!important}
  body.hm185-app .app-shell .page-content{padding:26px 28px 48px!important}
  body.hm185-app .app-shell .page-content :is(.form-grid,.hm-ui-fields,.owner-fields,.user-fields,.settings-fields-grid,.receipt-grid-v68,.account-field-grid){grid-template-columns:repeat(2,minmax(0,1fr))}
  body.hm185-app .hm185-sidebar-toggle{flex:0 0 36px;min-width:36px;width:36px;height:40px;border-radius:10px}
  body.hm185-app.hm185-nav-compact .sidebar{width:84px!important;overflow:visible!important}
  body.hm185-app.hm185-nav-compact .workspace{margin-right:84px!important;width:calc(100% - 84px)!important;max-width:calc(100% - 84px)!important}
  body.hm185-app.hm185-nav-compact .sidebar :is(.brand-copy,.sidebar-property,.hm185-nav-search,.sidebar-footer,.sidebar-nav .nav-label,.sidebar-nav .nav-section-label){display:none!important}
  body.hm185-app.hm185-nav-compact .sidebar .brand{justify-content:center;padding:10px 0!important}
  body.hm185-app.hm185-nav-compact .sidebar .sidebar-nav a{font-size:0!important;justify-content:center;gap:0;padding:12px!important;position:relative}
  body.hm185-app.hm185-nav-compact .sidebar .sidebar-nav a :not(svg):not(use){display:none!important}
  body.hm185-app.hm185-nav-compact .sidebar .sidebar-nav a::after{content:attr(aria-label);position:absolute;right:calc(100% + 10px);background:#1c2c43;color:white;font-size:13px;white-space:nowrap;padding:8px 12px;border-radius:8px;pointer-events:none;opacity:0}
  body.hm185-app.hm185-nav-compact .sidebar .sidebar-nav a:is(:hover,:focus-visible)::after{opacity:1}
  body.hm185-app .mobile-dock{display:none!important}
}
@media screen and (prefers-reduced-motion:reduce){
  body.hm185-app *,body.hm185-app *::before,body.hm185-app *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
