/* Медовые продажи 0.5.5 — iPhone/iOS readable mobile layout.
   Only presentation overrides; no JS/API, CRM, ledger or cron changes. */
@media screen and (max-width: 600px) {
  html { width: 100%; max-width: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { width: 100%; max-width: 100%; overflow-x: clip; }
  .app-shell { width: 100%; max-width: 100%; min-width: 0; margin: 0 auto;
    padding: 16px max(13px, env(safe-area-inset-left)) calc(20px + env(safe-area-inset-bottom)) max(13px, env(safe-area-inset-right)); }
  .content,.view,.card,.compact-card,.stat,.setting-grid,.setting-field,.overview-grid,.stats,.two-cards,
  .topbar,.brand-area,.brand-area>div,.topbar-right,.page-heading,.page-heading>div,.card-head,.card-head>div,
  .search-row,.button-row,.profile,.profile-heading,.feed-content,.numeric-box,.health-row,.health-row>span {
    min-width: 0; max-width: 100%;
  }
  .topbar { gap: 8px; align-items: center; padding: 4px 1px 13px; }
  .brand-area { gap: 9px; flex: 1 1 auto; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-area strong { font-size: 18px; line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
  .brand-area span { font-size: 12px; margin-top: 5px; line-height: 1.3; }
  .topbar-right { flex: 0 0 auto; }
  .crm-indicator { font-size: 12px; padding: 8px 10px; }
  .crm-indicator b { font-size: 12px; }
  /* Three wide buttons, then two: no horizontal-scrolling tab strip. */
  .tabs { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px;
    margin: 14px 0 20px; padding: 5px; overflow: visible; border-radius: 14px; }
  .tab { grid-column: span 2; min-width: 0; width: 100%; min-height: 46px;
    padding: 11px 4px; font-size: 14px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere;
    border-radius: 10px; }
  .tab:nth-last-child(-n+2) { grid-column: span 3; }
  .page-heading { gap: 10px; align-items: center; margin-bottom: 17px; }
  .eyebrow { font-size: 12px; letter-spacing: .11em; }
  .page-heading h1 { font-size: clamp(25px,6.7vw,30px); line-height: 1.14; margin: 5px 0 6px; }
  .page-heading p { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
  .page-heading .btn-sm { min-height: 44px; padding: 10px 12px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
  .btn,.btn-sm { font-size: 15px; min-height: 48px; padding: 12px 14px; line-height: 1.3;
    max-width: 100%; overflow-wrap: anywhere; }
  .btn-link { width: 100%; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; margin-bottom: 14px; }
  .stat { padding: 16px 14px; min-height: 135px; border-radius: 16px; }
  .stat span { font-size: 13px; line-height: 1.4; }
  .stat strong { font-size: clamp(24px,7vw,31px); line-height: 1.08; margin: 14px 0 6px;
    letter-spacing: -.04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .stat small,.stat small span { font-size: 12px; line-height: 1.4; }
  .overview-grid,.setting-grid,.two-cards { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .card,.compact-card { padding: 19px 17px; border-radius: 17px; margin-bottom: 13px; }
  .card-head { gap: 11px; align-items: flex-start; margin-bottom: 16px; }
  .card-head h2 { font-size: 19px; line-height: 1.25; }
  .card-head p { font-size: 14px; line-height: 1.45; }
  .text-action { font-size: 14px; min-height: 30px; text-align: right; white-space: nowrap; flex: 0 0 auto; }
  .feed { min-height: 145px; }
  .feed-row { gap: 10px; padding: 14px 0; }
  .feed-content strong { font-size: 14px; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; }
  .feed-content small { font-size: 12px; line-height: 1.35; white-space: normal; }
  .feed-amount { font-size: 15px; }
  .health-row { gap: 12px; align-items: flex-start; padding: 14px 0; font-size: 14px; line-height: 1.4; }
  .health-row span { flex: 1 1 auto; gap: 9px; }
  .health-row b { flex: 0 1 54%; font-size: 14px; font-weight: 750; line-height: 1.35;
    white-space: normal; overflow-wrap: anywhere; }
  .mini-info,.muted,.inline-info,.notice { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
  .mini-info { padding: 15px 14px; }
  .notice { padding: 14px; }
  input,select,textarea { font-size: 16px!important; min-height: 49px; max-width: 100%; }
  input[type="checkbox"],input[type="radio"] { min-height: 0; }
  .search-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 9px; }
  .search-row .btn,.search-row button { width: 100%; font-size: 15px; min-height: 48px; }
  .button-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
  .button-row .btn { width: 100%; }
  .divider { margin: 20px 0; }
  .client-item { padding: 15px 2px; gap: 10px; }
  .client-item strong { font-size: 15px; overflow-wrap: anywhere; }
  .client-item small { font-size: 13px; }
  .client-item b { font-size: 15px; white-space: normal; text-align: right; }
  .profile-heading strong { font-size: 18px; }
  .profile-balance { font-size: 30px; }
  .profile-meta { font-size: 14px; }
  .profile-table { table-layout: fixed; max-width: 100%; }
  .profile-table th { font-size: 12px; }
  .profile-table td { font-size: 13px; padding: 12px 6px; overflow-wrap: anywhere; }
  .action-detail { padding: 19px 17px; }
  .action-detail summary { font-size: 16px; line-height: 1.45; }
  .action-form { gap: 13px; }
  .action-form label { font-size: 14px; }
  .badge { font-size: 13px; line-height: 1.25; white-space: normal; text-align: center; }
  .setting-field { padding: 16px; }
  .setting-field label { font-size: 15px; line-height: 1.4; }
  .setting-field small { font-size: 13px; }
  .setting-grid { gap: 12px; }
  .numeric-box { gap: 10px; }
  .numeric-box input { flex: 1 1 auto; width: 100%; max-width: none; font-size: 17px!important; }
  .numeric-box span { flex: 0 0 auto; font-size: 14px; white-space: normal; }
  .policy-row { gap: 10px; padding: 15px; }
  .policy-row strong { font-size: 14px; }
  .policy-row p { font-size: 13px; }
  .card-level-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; padding: 13px; }
  .card-level-row label { font-size: 14px; min-width: 0; }
  .card-level-row label:first-child { grid-column: 1/-1; }
  .card-level-row input { font-size: 16px; max-width: 100%; }
  .inline-switch { font-size: 15px; line-height: 1.45; }
  .inline-switch input { width: 22px; height: 22px; flex: 0 0 22px; }
  .readonly-setting { font-size: 15px; }
  .auth-card { max-width: 100%; margin: 35px 0 45px; padding: 25px 20px; }
  .auth-card h1 { font-size: 28px; }
  .auth-card p { font-size: 15px; }
  .auth-card label { font-size: 14px; }
  #toast { left: 13px; right: 13px; bottom: max(15px,env(safe-area-inset-bottom));
    max-width: none; font-size: 14px; line-height: 1.5; }
  .footer { font-size: 12px; line-height: 1.5; padding: 20px 4px; }
}
@media screen and (max-width: 355px) {
  .brand-logo { width: 45px; height: 45px; }
  .brand-area strong { font-size: 17px; }
  .brand-area span { display: none; }
  .crm-indicator { padding: 7px 9px; }
  .page-heading { flex-wrap: wrap; }
  .page-heading .btn-sm { min-width: 0; max-width: 100%; }
  .stat { padding: 14px 12px; }
  .stat strong { font-size: 24px; }
}

/* v0.6: client administration */
.client-admin-panel{margin-top:18px;padding:16px;border-radius:18px;background:#f7f8f5;border:1px solid #e1e9e2}.client-admin-panel.hidden{display:none!important}.client-admin-panel h3{font-size:20px;margin:0 0 8px}.admin-inline{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;margin:18px 0;align-items:end}.admin-inline label{display:block;font-weight:600;font-size:14px}.admin-inline input,.admin-inline select,#salesGroup,#clientFilter{width:100%;min-width:0;font-size:16px;padding:12px;margin-top:6px;border:1px solid #d7ded7;border-radius:10px;background:white;color:#273b31}.profile-links{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0}.audit-rows{font-size:13px;line-height:1.5}.client-state-pill{font-size:12px;color:#62766b}.client-item{gap:10px;flex-wrap:wrap}
@media(max-width:700px){.admin-inline{grid-template-columns:1fr}.admin-inline .btn{width:100%}.profile-links .btn{width:100%}#clientFilter{width:100%}}
