/* Ham-Melk v157 — mobile-first usability polish. Isolated from business logic. */
@media screen and (max-width:900px){
  /* Use available OS Persian fonts. No downloaded font or dependency needed. */
  body{--app-font-family:"Vazirmatn","Noto Sans Arabic",Tahoma,"Segoe UI",Arial,sans-serif;font-family:var(--app-font-family)!important;-webkit-text-size-adjust:100%;text-size-adjust:100%}
  .app-shell :is(h1,h2,h3,.topbar-title>b,.sidebar-nav){font-family:inherit!important}
  /* The off-canvas sidebar is a modal navigation surface, not page content. */
  body.sidebar-open{overflow:hidden!important;overscroll-behavior:contain}
  body.sidebar-open .sidebar{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
  body.sidebar-open .sidebar-nav{overscroll-behavior:contain}
  .app-shell,.workspace,.page-content{min-width:0;max-width:100%}
  .app-shell .page-content{padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))!important}
  .app-shell .topbar-title{min-width:0;overflow-wrap:anywhere}
  .app-shell .topbar-title b{line-height:1.45!important}
  /* Prevent iOS Safari zoom-on-focus and make all text entry readable. */
  .app-shell :is(input[type=text],input[type=search],input[type=email],input[type=tel],input[type=url],input[type=password],input[type=number],input:not([type]),textarea,select){font-size:16px!important;line-height:1.5!important;max-width:100%}
  /* Numeric/Latin identifiers remain readable and wrap instead of widening forms. */
  body.owner-interface-v80 .page-content :is(.owner-next-v44,.owner-credit-compact-v44,.period-card,.message-card,.history-record,.account-card,.charge-list-panel-v46){min-width:0;max-width:100%}
  body.owner-interface-v80 .page-content :is(.owner-next-v44,.owner-credit-compact-v44,.owner-alert-content-v81,.message-card,.history-record,.account-card){overflow-wrap:anywhere}
  body.owner-interface-v80 :is(.owner-stay-main-action-v33,.owner-action-card-v81,.hm148-owner-summary__item,.owner-shortcut-v81){touch-action:manipulation}
  body.owner-interface-v80 :is(.owner-stay-main-action-v33,.owner-action-card-v81,.hm148-owner-summary__item,.owner-shortcut-v81):focus-visible{outline:3px solid #285ee5!important;outline-offset:3px}
  /* Keyboard entry: navigation dock must not sit over the current field. */
  body.hm157-form-focus .mobile-dock{display:none!important}
  body.hm157-form-focus .app-shell .page-content{padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))!important}
  /* Visible UI status text: avoid hidden 10px micro-copy in owner flows. */
  body.owner-interface-v80 :is(.account-summary-grid article span,.owner-upcoming-v44 .period-type,.hm-pledge-wizard-hint){font-size:max(12px,var(--ty-meta,13px))!important;line-height:1.65!important}
  body.owner-interface-v80 .hm148-owner-summary__item small{font-size:13px!important;line-height:1.6!important}
  body.owner-interface-v80 .owner-alert-content-v81 small{font-size:14px!important}
  .hm157-calendar-mobile-hint{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 12px;margin:8px 0;background:#f0f6ff;border:1px solid #d7e5fb;border-radius:12px;color:#3b577b;font-size:13px;line-height:1.7}
  .hm157-calendar-mobile-hint a{font-weight:850;color:#2857a8;text-decoration:none;min-height:44px;display:inline-flex;align-items:center}
  .hm157-calendar-mobile-hint a:focus-visible{outline:2px solid #285ee5;outline-offset:2px}
}
.hm157-calendar-mobile-hint{display:none}
@media screen and (max-width:900px){.hm157-calendar-mobile-hint{display:flex}}
@media screen and (max-width:359px){
  body.owner-interface-v80 .owner-primary-actions-v44{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.owner-interface-v80 .owner-primary-actions-v44>.owner-action-card-v81:first-child{grid-column:1/-1}
  body.owner-interface-v80 .hm148-owner-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .mobile-dock a,.mobile-dock button{font-size:12px!important;min-width:0;padding-inline:2px!important}
}
/* Notification preferences: a compact, accessible settings screen for owners. */
.hm157-notice-page{width:min(100%,850px);margin-inline:auto;min-width:0}
.hm157-notice-head{background:linear-gradient(130deg,#f2f7ff,#fff);border:1px solid #dbe5f5;border-radius:18px;padding:18px 20px;margin-bottom:14px}
.hm157-notice-head h1{font-size:clamp(20px,2.2vw,24px)!important;line-height:1.5!important;margin:6px 0!important}
.hm157-notice-head p{color:#526580;margin:0;font-size:14px;line-height:1.8}
.hm157-notice-form{display:grid;gap:14px}
.hm157-notice-section{background:#fff;border:1px solid #dce5ef;border-radius:18px;padding:17px;min-width:0}
.hm157-notice-section h2{font-size:17px!important;margin:0 0 14px!important}
.hm157-notice-switch{display:flex;align-items:center;gap:13px;min-width:0;min-height:64px;padding:11px 12px;border:1px solid #e4eaf3;border-radius:12px;margin-bottom:9px;cursor:pointer;color:#273b55;background:#fafcff}
.hm157-notice-switch>input[type=checkbox]{flex:0 0 23px!important;width:23px!important;height:23px!important;min-width:23px!important;min-height:23px!important;margin:0;accent-color:#3468cf;cursor:pointer}
.hm157-notice-switch>span{min-width:0;display:grid;gap:3px}
.hm157-notice-switch strong{display:block;font-size:15px;font-weight:850;line-height:1.5}
.hm157-notice-switch small{display:block;font-size:13px;line-height:1.7;color:#586d86}
.hm157-notice-field{display:grid;gap:7px;font-size:14px;font-weight:800;margin:2px 0 11px}
.hm157-notice-field>input{font-size:16px!important;min-height:48px;border:1px solid #d4dfed;border-radius:10px;padding:9px 12px}
.hm157-notice-links{display:flex;flex-wrap:wrap;gap:7px;margin:-1px 0 13px;padding-inline:3px}
.hm157-notice-links a{display:inline-flex;align-items:center;min-height:44px;font-size:13px;color:#2459b4;background:#eef4ff;border:1px solid #d9e7ff;border-radius:10px;padding:7px 11px;text-decoration:none;font-weight:800}
.hm157-notice-tip{font-size:13px;color:#526580;line-height:1.8;margin:3px 0 0}
.hm157-notice-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:#fff;border:1px solid #dce5ef;border-radius:16px;padding:14px 17px}
.hm157-notice-actions button{min-height:48px!important;font-size:15px!important}
.hm157-notice-actions p{margin:0;color:#5d6e84;font-size:13px;line-height:1.7}
.hm157-notice-page :is(input,button,a):focus-visible{outline:3px solid #3a75d8;outline-offset:2px}
@media(max-width:600px){
  .hm157-notice-head{padding:14px}
  .hm157-notice-section{padding:12px;border-radius:14px}
  .hm157-notice-switch{padding:10px;min-height:66px}
  .hm157-notice-actions{display:grid;gap:7px;padding:12px}
  .hm157-notice-actions button{width:100%}
}
@media(prefers-reduced-motion:reduce){.hm157-notice-page *{scroll-behavior:auto!important}}
/* Owner messenger assistant: secondary links must be thumb-friendly. */
@media screen and (max-width:900px){
  body.owner-interface-v80 .eas-footer a{
    display:inline-flex;align-items:center;justify-content:center;
    min-height:44px;padding:9px 12px;margin:2px;
    border:1px solid #d6e4f7;border-radius:10px;
    background:#f2f6ff;color:#2857a8;text-decoration:none;
    font-size:14px;line-height:1.5;
  }
  .hm157-notice-switch small{font-size:14px}
}
