/**
 * ACC Portal Mobile Polish — readable, clean phone UI across all portals.
 * Loaded after portal-tabbar.css. Breakpoint: ≤720px (matches Digikala tabbar).
 */
@media (max-width: 720px) {
  :root {
    --acc-m-text: 17px;
    --acc-m-small: 14px;
    --acc-m-tiny: 13px;
    --acc-m-title: 1.35rem;
    --acc-m-lead: 1.05rem;
    --acc-m-pad: 14px;
    --acc-tabbar-h: 62px;
  }

  html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body.sp-body,
  body.svc-body,
  body.melk-body,
  body.edu-body,
  body.el-body,
  body.election-body,
  body.ws-body,
  body.wholesale-body,
  body.growth-body,
  body.erp-applied-body,
  body.mk-body,
  body.acc-body,
  body.erp-shop-body,
  body.sacct-body,
  body.mz-body,
  body.pl-body,
  body.dev-body,
  body {
    font-size: var(--acc-m-text);
    line-height: 1.65;
  }

  /* ── Base readability bumps ── */
  p, li, label, td, th, .hl-portal__go,
  .ba-portal__go, .ha-portal__go, .ma-portal__go,
  .ea-portal__go, .ga-portal__go {
    font-size: max(1em, var(--acc-m-small));
  }

  small, .muted, .hl-portal small, .ba-pillar span,
  .ha-portal small, .ma-portal small, .ea-portal small {
    font-size: var(--acc-m-tiny) !important;
    line-height: 1.55 !important;
  }

  /* Headings */
  h1, .hl-hero h1, .ba-hero h1, .ha-hero h1, .ma-hero h1,
  .ea-hero h1, .ga-hero h1, .ws-hero h1 {
    font-size: clamp(1.55rem, 6.2vw, 2rem) !important;
    line-height: 1.25 !important;
  }

  h2, .hl-section h2, .ba-section h2, .ha-section h2,
  .ma-section h2, .ea-section h2, .ga-section h2 {
    font-size: clamp(1.2rem, 4.8vw, 1.45rem) !important;
  }

  .hl-hero__lead, .ba-hero__lead, .ha-hero__lead,
  .ma-hero__lead, .ea-hero__lead, .ga-hero__lead,
  .ws-hero p, .hl-hero__lead {
    font-size: var(--acc-m-lead) !important;
    line-height: 1.7 !important;
  }

  /* Sticky headers — roomier */
  .ba-header, .ha-header, .ma-header, .ea-header,
  .ga-header, .hl-header, .ws-header,
  .svc-header--app, .melk-header--app, .el-header--app,
  .edu-header, .ga-ws-header, .acc-header, .mk-top {
    min-height: 56px;
  }

  .ba-brand__name, .ha-brand__name, .ma-brand__name,
  .ea-brand__name, .ga-brand__name, .hl-brand__name {
    font-size: 1rem !important;
  }

  .ba-brand__sub, .ha-brand__sub, .ma-brand__sub,
  .ea-brand__sub, .ga-brand__sub, .hl-brand__sub {
    font-size: 11px !important;
  }

  /* Icon buttons / CTAs — thumb friendly */
  .ba-icon-btn, .ba-header__cta, .ha-header__cta,
  .hl-header__cta, .hl-btn, .ha-btn, .ma-btn, .ea-btn,
  .ga-btn, .ws-btn, .svc-btn, .edu-btn, .el-btn, .mk-btn,
  .acc-btn, .lp-btn {
    min-height: 44px;
    font-size: 15px !important;
    padding-block: 10px;
  }

  .ba-icon-btn .label {
    font-size: 12px !important;
  }

  /* Portal cards */
  .hl-portal, .ha-portal, .ma-portal, .ea-portal,
  .ba-portal, .ga-portal {
    padding: 16px 14px !important;
  }

  .hl-portal strong, .ha-portal strong, .ma-portal strong,
  .ea-portal strong, .ga-portal strong {
    font-size: 1.05rem !important;
  }

  .hl-portal__tag, .ha-portal__tag, .ma-portal__tag,
  .ea-portal__tag, .ga-portal__tag {
    font-size: 12px !important;
  }

  /* Sections padding */
  .hl-section, .ha-section, .ma-section, .ea-section,
  .ga-section, .ba-section, .ws-section {
    padding-inline: var(--acc-m-pad) !important;
  }

  .hl-wrap, .sp-wrap, .svc-app, .melk-app, .edu-app,
  .el-app, .ws-app, .growth-app, .mk-app, .acc-layout {
    padding-inline: max(0px, env(safe-area-inset-left));
  }

  /* Workspace tabs (when still visible) */
  .svc-ws-tab, .em-main-tab, .el-tab, .ws-tab,
  .edu-header__nav button, .ga-ws-nav button {
    font-size: 14px !important;
    min-height: 42px;
    padding: 8px 12px !important;
  }

  /* Forms */
  input, select, textarea, .acc-input, .lp-field input,
  .sp-search__input, .mk-input {
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: 44px;
  }

  /* Tables / lists denser but readable */
  .tabulator, .tabulator .tabulator-cell,
  .tabulator .tabulator-col-content {
    font-size: 14px !important;
  }

  /* Shop specifics */
  .sp-tile__title, .sp-catalog h3, .sp-pdp__title {
    font-size: 1.1rem !important;
  }

  .sp-tile__price, .sp-price, .sp-pdp__price {
    font-size: 1.05rem !important;
  }

  .sp-footer, .ha-footer, .hl-footer, .ma-footer, .ea-footer {
    font-size: 14px !important;
    padding: 18px var(--acc-m-pad) !important;
  }

  .sp-footer__nav a, .hl-footer a {
    font-size: 14px !important;
  }

  /* Track float */
  #sp-track-float {
    font-size: 18px !important;
    width: 52px;
    height: 52px;
  }

  /* Auth panels */
  .lp-form__title, .acc-login-box h2, .svc-login h1,
  .edu-login h1, .mk-auth h1 {
    font-size: 1.25rem !important;
  }

  .lp-msg, .acc-msg, .svc-msg, .svc-demo-hint,
  .edu-demo-row__user, code {
    font-size: 13px !important;
  }

  /* KPI / chips */
  .mk-kpi__val, .ha-kpi__val, .ga-kpi__val {
    font-size: 1.25rem !important;
  }

  .mk-kpi__lbl, .ha-kpi__lbl, .mk-chip {
    font-size: 13px !important;
  }

  /* Account sidebar as horizontal strip */
  .acc-nav a, .acc-sidebar a {
    font-size: 14px !important;
    min-height: 42px;
  }

  /* Admin / ERP shop / accounting */
  .sp-admin__head, .erp-header, .sacct-nav a, .sacct-nav button,
  .erp-sidebar a, .erp-sidebar button, .sp-admin__tabs button {
    font-size: 15px !important;
    min-height: 44px;
  }
  .sacct-nav, .erp-sidebar { font-size: 15px !important; }
  .sp-admin table, .erp-shop-body table, .sacct-body table,
  .sacct-body td, .sacct-body th, .erp-shop-body td, .erp-shop-body th {
    font-size: 14px !important;
  }

  /* Mizaj */
  .mz-header, .mz-card, .mz-q, .mz-opt, .mz-result { font-size: 16px !important; }
  .mz-opt { min-height: 48px; padding: 12px 14px !important; }

  /* Platform + API docs */
  .pl-header, .pl-nav a, .pl-btn, .pl-hero p, .pl-card, .pl-feature, .pl-price,
  .docs, .docs table, .docs td, .docs th {
    font-size: 15px !important;
  }
  .pl-hero h1, .docs h1 { font-size: clamp(1.55rem, 6vw, 2rem) !important; }
  .docs code, .docs pre { font-size: 13px !important; }
  .pl-nav { display: none !important; }

  /* Dev portal */
  .dev-login h1, .dev-brand__name, .dev-header, .dev-tabs button, .dev-doc, .dev-card {
    font-size: 15px !important;
  }
  .dev-input { min-height: 44px; font-size: 16px !important; }

  /* Deploy portal */
  .wrap h1 { font-size: 1.5rem !important; }
  .wrap .lead, .wrap .meta, .wrap label { font-size: 15px !important; }
  .wrap .btn { font-size: 16px !important; min-height: 48px; }

  /* Util bars */
  .ba-util, .ha-util, .ma-util, .ea-util, .hl-util, .ga-util {
    font-size: 13px !important;
  }

  /* Mobile tabbar labels a bit larger */
  .acc-portal-tabbar__item {
    font-size: 13px !important;
  }
  .acc-portal-tabbar__icon svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Extra-small phones */
@media (max-width: 390px) {
  html { font-size: 16px; }
  :root {
    --acc-m-text: 16px;
    --acc-m-small: 13.5px;
    --acc-m-tiny: 12.5px;
  }
}

/* Chat widget — force larger type on all phones (overrides residual tiny rules) */
@media (max-width: 720px) {
  #acc-chat-window,
  #acc-chat-window * {
    -webkit-text-size-adjust: 100%;
  }
  #acc-chat-launcher .cw-launcher-label { font-size: 15px !important; }
  #acc-chat-window .cw-tab { font-size: 15px !important; }
  #acc-chat-window .cw-tab-icon { font-size: 26px !important; }
  #acc-chat-window .cw-header-name { font-size: 18px !important; }
  #acc-chat-window .cw-welcome-title { font-size: 19px !important; }
  #acc-chat-window .cw-welcome-sub { font-size: 16px !important; }
  #acc-chat-window .cw-msg,
  #acc-chat-window .cw-msg-bubble,
  #acc-chat-window .cw-bubble,
  #acc-chat-window .cw-message,
  #acc-chat-window p {
    font-size: 17px !important;
    line-height: 1.65 !important;
  }
  #acc-chat-window .cw-qa-item,
  #acc-chat-window .cw-service-label,
  #acc-chat-window .cw-contact-label,
  #acc-chat-window button:not(.cw-tab) {
    font-size: 16px !important;
  }
  #acc-chat-window textarea,
  #acc-chat-window input {
    font-size: 17px !important;
  }
  #acc-chat-window .shop-ai,
  #acc-chat-window .ws-ai,
  #acc-chat-window .shop-ai-sug,
  #acc-chat-window .shop-ai__chips button,
  #acc-chat-window .ws-ai__chips button {
    font-size: 16px !important;
  }
}
