/* Phone layout on top of the shared panel styles (sidepanel.css). */
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 20; padding-top: calc(12px + env(safe-area-inset-top)); }
main { width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 96px; }
.demo-banner, .notice { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Bigger touch targets than the laptop panel */
.btn { min-height: 44px; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn-xs { min-height: 38px; padding: 7px 12px; font-size: 13.5px; font-weight: 600; border-radius: 8px; }
.pill { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.card-actions { gap: 6px; }
input, select, textarea { font-size: 16px; } /* stops iPhone zooming into fields */
.icon-btn { width: 40px; height: 40px; }
.icon-btn svg { width: 19px; height: 19px; }
.btn-wa { background: #1f9d57; color: #ffffff; }
.btn-wa svg { width: 15px; height: 15px; margin-right: 5px; vertical-align: -2px; }

/* Bottom navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { position: relative; border: 0; background: none; color: var(--ink-2); padding: 9px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; min-height: 60px; cursor: pointer; }
.bottom-nav svg { width: 23px; height: 23px; }
.bottom-nav button[aria-current="page"] { color: var(--brand); }
.nav-badge { position: absolute; top: 5px; left: calc(50% + 6px); background: var(--warn); color: #ffffff; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 999px; }

/* New order button */
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 14px 20px 14px 16px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 16px; box-shadow: 0 6px 18px rgb(0 0 0 / 0.22); cursor: pointer; }
.fab svg { width: 22px; height: 22px; }
.fab[hidden] { display: none; }

/* Dialogs as bottom sheets on phones */
dialog { width: min(100vw, 560px); max-height: 92dvh; overflow: auto; }
@media (max-width: 560px) {
  dialog { margin: auto 0 0 0; max-width: 100vw; border-radius: 18px 18px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.about { margin-top: 18px; text-align: center; }
.about a, .hint a { color: var(--brand); }
#tab-replies .hint { margin-top: 4px; }

@media (min-width: 700px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Toasts sit above the bottom bar and the + Order button */
.toast { left: 16px; right: 16px; transform: none; max-width: 560px; margin: 0 auto; bottom: calc(146px + env(safe-area-inset-bottom)); z-index: 40; text-align: center; }
/* v0.5 */
#backupNotice { flex-wrap: wrap; }
#restoreDialog .form > .btn { width: 100%; }
