/* Phone-only admin presentation. No storefront or business-rule changes. */
@media (max-width: 767px) {
  .ak-shell, .ak-main, .ak-content, .ak-content > *, .ak-content form { min-width: 0; }
  .ak-content { padding: 20px 16px !important; }
  .ak-header { gap: 10px; padding: 8px 12px !important; min-height: 64px; height: auto !important; }
  .ak-header-left { min-width: 0; flex: 1; gap: 8px; }
  .ak-header .ak-page-title { font-size: 16px; line-height: 1.3; overflow-wrap: normal; word-break: normal; }
  .ak-header-right { flex-shrink: 0; gap: 6px; }
  .ak-header .ak-admin-badge { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .ak-mobile-menu-btn, .ak-logout-btn { min-width: 44px; min-height: 44px; }
  .ak-content .ak-page-header, .ak-content .ak-page-actions { flex-wrap: wrap; gap: 12px; }
  .ak-content .ak-page-header > *, .ak-content .ak-page-actions > * { min-width: 0; max-width: 100%; }
  .ak-content .ak-stats-grid, .ak-content div:has(> .ak-stat-card) {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 12px !important;
  }
  .ak-content .ak-stat-card { min-width: 0; height: auto; min-height: 136px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .ak-content .ak-stat-icon { width: 36px; height: 36px; flex: 0 0 36px; font-size: 18px; }
  .ak-content .ak-stat-body { min-width: 0; width: 100%; }
  .ak-content .ak-stat-value { font-size: clamp(17px,4.5vw,24px); line-height: 1.25; white-space: nowrap; word-break: normal; overflow-wrap: normal; font-variant-numeric: tabular-nums; }
  .ak-content .ak-stat-label { margin-top: 6px; font-size: 12px; line-height: 1.45; color: #bfc3cb; white-space: normal; word-break: normal; overflow-wrap: normal; }
  .ak-content .ak-tabs { display: flex; flex-wrap: wrap; overflow: visible !important; height: auto !important; gap: 8px; padding: 4px 0 14px; }
  .ak-content .ak-tab { flex: 0 1 auto; min-height: 44px; white-space: normal; border-radius: 8px; padding: 10px 12px; }
  .ak-content .ak-toolbar, .ak-content .ak-toolbar-left, .ak-content .ak-toolbar-right { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
  .ak-content .ak-toolbar { position: static !important; }
  .ak-content .ak-toolbar-left, .ak-content .ak-toolbar-right { width: 100%; }
  .ak-content .ak-search-input { width: 100% !important; min-width: 0 !important; max-width: 100%; }
  .ak-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .ak-content select, .ak-content textarea {
    box-sizing: border-box; min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px !important;
  }
  .ak-content button:not(.ak-toggle), .ak-content .ak-btn, .ak-content .ak-icon-btn { min-height: 44px; }
  .ak-content .ak-icon-btn, .ak-content .ak-page-btn { min-width: 44px; }
  .ak-content .ak-bool-btn { min-width: 44px; min-height: 44px; }
  /* Keep the 24px switch track, with an extended 44px touch area. */
  .ak-content button.ak-toggle-btn { min-height: 24px; height: 24px; margin: 10px 0; flex-shrink: 0; }
  .ak-content button.ak-toggle-btn::after { content: ""; position: absolute; inset: -10px 0; }
  .ak106-leads .ak-content > div > .ak-page-header + div { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 16px; }
  .ak106-leads .ak-content > div > .ak-page-header + div > div { min-width: 0 !important; }
  .ak106-leads .ak-content > div > .ak-page-header + div > div:last-child { grid-column: 1 / -1; }
  .ak106-leads .ak-card:has(input[placeholder="Search name, email, phone…"]) { padding: 16px; }
  .ak106-leads .ak-card input[placeholder="Search name, email, phone…"] { width: 100% !important; }
  .ak106-leads .ak-card div:has(> input[placeholder="Search name, email, phone…"]) { width: 100%; margin-left: 0 !important; }
  .ak-content label:has(input[type=checkbox]), .ak-content label:has(input[type=radio]) { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
  .ak-content input[type=checkbox], .ak-content input[type=radio] { width: 20px; height: 20px; flex-shrink: 0; }
  .ak-content .ak-row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .ak-content .ak-pagination { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 16px 0; }
  .ak-content .ak-pagination-controls { display: flex; flex-wrap: wrap; gap: 8px; }
  .ak-content .ak-pagination-info, .ak-content .ak-table-footer { white-space: normal; }
  .ak-modal { box-sizing: border-box; width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 24px); overflow-y: auto; }
  .ak-modal-overlay { padding: 12px; }
  .ak105-table-host { overflow: visible !important; max-width: 100%; }
  table.ak105-records { display: block; width: 100% !important; min-width: 0 !important; table-layout: auto; }
  table.ak105-records thead { display: block; }
  table.ak105-records thead tr { display: flex; flex-wrap: wrap; gap: 8px; }
  table.ak105-records th { display: block; padding: 0; border: 0; }
  table.ak105-records th:not(:has(button,input)) { position: absolute; width: 1px !important; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  table.ak105-records th:has(button,input) { margin: 8px 0; }
  table.ak105-records th button { min-height: 44px; padding: 10px 12px; border: 1px solid #444; border-radius: 8px; }
  table.ak105-records tbody { display: grid; gap: 12px; }
  table.ak105-records tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; padding: 16px; border: 1px solid #383838; border-radius: 12px; background: #191919; }
  table.ak105-records tbody td { display: block; min-width: 0; width: auto !important; max-width: none !important; padding: 12px 0 !important; border: 0; border-bottom: 1px solid #333; white-space: normal !important; overflow-wrap: anywhere; font-size: 14px !important; line-height: 1.5; color: #d7d9df; }
  table.ak105-records tbody td::before { content: attr(data-mobile-label); display: block; margin-bottom: 6px; color: #bfc3cb; font: 600 11px/1.4 Arial,sans-serif; letter-spacing: .04em; text-transform: uppercase; }
  table.ak105-records tbody td[data-mobile-label=""]::before { display: none; }
  table.ak105-records tbody td.ak105-wide { grid-column: 1 / -1; }
  table.ak105-records tbody td.ak105-empty { padding: 24px 8px !important; text-align: center; border: 0; }
  table.ak105-records tbody td:last-child { border-bottom: 0; }
  table.ak105-records tbody td > div { max-width: 100%; }
  table.ak105-records tbody td > div[style*="flex"] { flex-wrap: wrap; }
  table.ak105-records tbody td select { width: 100%; }
  table.ak105-records tbody td input[type=number] { width: 100% !important; }
  table.ak105-records tbody td a { overflow-wrap: anywhere; }
  .ak105-loyalty .top { height: auto; min-height: 72px; padding: 16px; gap: 14px; flex-wrap: wrap; }
  .ak105-loyalty .top a { display: inline-flex; align-items: center; min-height: 44px; }
  .ak105-loyalty .brand { font-size: 20px; }
  .ak105-loyalty .main { padding: 20px 16px; min-width: 0; }
  .ak105-loyalty .title { gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .ak105-loyalty .title h1 { font-size: 28px; }
  .ak105-loyalty .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .ak105-loyalty .card { padding: 16px; min-width: 0; }
  .ak105-loyalty .metric { font-size: 28px; white-space: nowrap; }
  .ak105-loyalty .toolbar { flex-wrap: wrap; padding: 16px; }
  .ak105-loyalty .toolbar input { width: 100%; min-width: 0; flex: 1 1 100%; font-size: 16px; }
  .ak105-loyalty button { min-height: 44px; }
  .ak105-loyalty .perks { grid-template-columns: 1fr; }
  .ak105-loyalty .panel { overflow: visible; }
}
