/* HisabiApp - Modern Mobile First Design System */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --header-height: 62px;
  --bottom-nav-height: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Hind Siliguri', 'Inter', -apple-system, sans-serif;
  background-color: #f1f5f9;
  color: var(--slate-800);
  line-height: 1.5;
  user-select: none;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  max-width: 540px; /* Perfect native mobile view centered on desktop */
  margin: 0 auto;
  min-height: 100vh;
  background-color: #f8fafc;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .app-container.desktop-expanded {
    max-width: 1000px;
  }
}

/* Header */
.app-header {
  min-height: var(--header-height);
  height: auto;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.header-brand > div { min-width: 0; }
.header-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-logo, .header-actions, .icon-btn { flex-shrink: 0; }

.header-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--white);
  padding: 2px;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-subtitle {
  font-size: 0.72rem;
  opacity: 0.85;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.95);
}

/* Main Content Area */
.app-body {
  flex: 1;
  padding: 14px 14px calc(var(--bottom-nav-height) + 90px + env(safe-area-inset-bottom)) 14px;
  min-width: 0;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--white);
  border-top: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--slate-500);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
  min-width: 0;
}

.nav-item i, .nav-item svg {
  font-size: 1.25rem;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active svg {
  transform: scale(1.15);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

/* Floating Action Button */
.fab-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
  right: calc(50% - 250px);
  width: 54px;
  height: 54px;
  border-radius: 28px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 45;
  transition: transform 0.2s ease, box-shadow 0.2s;
}

@media (max-width: 560px) {
  .fab-btn {
    right: 18px;
  }
}

.fab-btn:active {
  transform: scale(0.92);
}

/* Cards & Widgets */
.stat-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--slate-200);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s;
}

.stat-card:active {
  transform: scale(0.99);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 500;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-top: 2px;
  font-family: 'Inter', 'Hind Siliguri', sans-serif;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-amber { background: #fef3c7; color: #b45309; }

/* Lists & Items */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item-card {
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--slate-200);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.list-item-card:hover {
  border-color: #cbd5e1;
}

.list-item-card:active {
  background-color: var(--slate-50);
}

/* Modals & Bottom Sheets */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--white);
  width: 100%;
  max-width: 540px;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 28px 18px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: var(--slate-200);
  border-radius: 3px;
  margin: 0 auto 16px auto;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--slate-100);
}

.sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--slate-800);
}

/* Form Controls */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--slate-200);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--slate-800);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Search Bar */
.search-container {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 24px;
  border: 1.5px solid var(--slate-200);
  background: var(--white);
  font-size: 0.9rem;
  outline: none;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

/* Segmented Tabs */
.tab-pills {
  display: flex;
  background: var(--slate-200);
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tab-pill {
  flex: 1 1 90px;
  text-align: center;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-pill.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Notification & Toast */
.toast-msg {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--slate-900);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
  overflow-wrap: anywhere;
}

/* Narrow screens and large text must retain accessible controls. */
.app-container { width: 100%; min-height: 100dvh; }
.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card, .list-item-card, .sheet-title { min-width: 0; overflow-wrap: anywhere; }
.form-input, .form-select, .form-textarea, .search-input { min-width: 0; max-width: 100%; font-size: 16px; }
button { font-family: inherit; white-space: normal; }
.modal-sheet { max-height: 90dvh; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.sheet-header { gap: 10px; }
#menu-subcontent + div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#impersonation-banner { gap: 8px; flex-wrap: wrap; }
#pwa-install-banner { flex-wrap: wrap; }
@media (max-width: 380px) {
  .header-actions { gap: 4px; }
  .header-brand { gap: 6px; }
  .header-title { font-size: 1rem; }
  .app-body { padding-left: 10px; padding-right: 10px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 1.1rem; }
  .nav-item { font-size: 0.65rem; }
  .list-item-card { flex-wrap: wrap; gap: 8px; }
  #app-content [style*="grid-template-columns: repeat(3"],
  #app-content [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Install PWA Banner */
.customer-ledger-sheet { padding-top: 0; background: #f8fafc; }
.customer-ledger-sheet .sheet-handle { margin-top: 12px; }
.customer-ledger-sheet .sheet-header { position: sticky; top: 0; z-index: 5; background: #f8fafc; padding: 12px 0; }
.customer-ledger-sheet .sheet-title { display: flex; align-items: center; gap: 8px; flex: 1; }
.ledger-back { border: 0; background: transparent; font-size: 24px; cursor: pointer; color: #475569; padding: 4px; }
.ledger-balance { background: white; border: 1px solid #e2e8f0; border-radius: 16px; padding: 18px; text-align: center; }
.ledger-balance > span { color: #64748b; font-size: 0.85rem; }
.ledger-balance > strong { display: block; font-size: 2rem; margin: 4px 0 16px; overflow-wrap: anywhere; }
.ledger-due { color: #dc2626; }.ledger-paid { color: #15803d; }
.ledger-totals { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid #f1f5f9; padding-top: 12px; gap: 10px; }
.ledger-totals span { color: #64748b; font-size: 0.8rem; }.ledger-totals b { display: block; color: #334155; margin-top: 3px; overflow-wrap: anywhere; }
.ledger-entry-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 14px 0 22px; }
.ledger-entry-actions .btn-primary { padding: 12px 6px; font-size: 0.9rem; }.ledger-entry-actions .btn-primary:last-child { background: #15803d; }
.ledger-list-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }.ledger-list-heading span { font-size: 0.8rem; color: #64748b; }
.ledger-transactions { display: flex; flex-direction: column; gap: 10px; }
.ledger-transaction { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px; overflow-wrap: anywhere; }
.ledger-transaction-main { display: flex; justify-content: space-between; gap: 10px; }.ledger-transaction-main > div { min-width: 0; }
.ledger-transaction h4 { font-size: 0.9rem; }.ledger-transaction time, .ledger-amount span { display: block; font-size: 0.7rem; color: #64748b; margin-top: 4px; }.ledger-amount { text-align: right; }.ledger-amount strong { font-size: 1rem; }
.ledger-note { background: #f8fafc; padding: 8px; margin-top: 10px; border-radius: 6px; font-size: 0.8rem; white-space: pre-wrap; }.ledger-memo { font-size: 0.75rem; color: #64748b; margin-top: 6px; }
.ledger-row-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }.ledger-row-actions button { font-size: 0.72rem; padding: 4px 10px; background: white; }
.ledger-delete { color: #b91c1c !important; }.ledger-empty { text-align: center; padding: 24px; color: #64748b; }
.ledger-more { position: relative; }.ledger-more summary { list-style: none; cursor: pointer; background: #e2e8f0; border-radius: 50%; width: 38px; height: 38px; text-align: center; font-size: 26px; }.ledger-more summary::-webkit-details-marker { display: none; }
.ledger-dropdown { position: absolute; top: 44px; right: 0; width: min(240px,75vw); background: white; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 10px 30px #0f172a26; padding: 6px; max-height: 60dvh; overflow-y: auto; }
.ledger-dropdown button, .ledger-dropdown a { display: block; width: 100%; border: 0; background: white; text-align: left; font-family: inherit; font-size: 0.9rem; padding: 11px; text-decoration: none; color: #334155; border-radius: 6px; cursor: pointer; }.ledger-dropdown button:hover, .ledger-dropdown a:hover { background: #f1f5f9; }.ledger-dropdown button:disabled { color: #94a3b8; cursor: default; }
.customer-info dt { color: #64748b; font-size: 0.8rem; }.customer-info dd { margin: 3px 0 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
#modal-close-button[hidden] { display: none; }
.menu-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.menu-options .tab-pill { min-width: 0; font-family: inherit; }
.menu-heading { font-size:1.25rem; margin:0 0 16px; color:#172554; }
.menu-home { display:grid; gap:10px; }
.menu-item { display:flex; align-items:center; gap:12px; width:100%; padding:14px; border:1px solid #e2e8f0; border-radius:14px; background:#fff; color:#334155; text-align:left; font-family:inherit; cursor:pointer; }
.menu-item:hover { background:#eff6ff; border-color:#bfdbfe; }
.menu-item-icon { display:grid; place-items:center; flex:0 0 42px; height:42px; border-radius:12px; background:#eff6ff; font-size:1.3rem; }
.menu-item-copy { flex:1; min-width:0; }
.menu-item-copy strong { display:block; font-size:1rem; color:#172554; }
.menu-item-copy small { display:block; margin-top:3px; font-size:.76rem; line-height:1.5; color:#64748b; overflow-wrap:anywhere; }
.menu-item-logout strong { color:#dc2626; }
.menu-item-logout .menu-item-icon { background:#fef2f2; }
.menu-page-heading { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.menu-page-heading h2 { font-size:1.1rem; margin:0; }
.menu-policy { padding:20px 0; text-align:center; font-size:.75rem; line-height:1.8; overflow-wrap:anywhere; }
.app-confirm-overlay { position:fixed; inset:0; z-index:3000; background:rgba(15,23,42,.5); display:flex; align-items:center; justify-content:center; padding:20px; }
.app-confirm-overlay[hidden] { display:none; }
.app-confirm-card { width:100%; max-width:380px; background:#fff; border-radius:20px; padding:22px; box-shadow:0 20px 60px #0003; }
.app-confirm-card h3 { margin:0 0 12px; color:#172554; }
.app-confirm-card p { margin:0 0 22px; color:#475569; line-height:1.8; overflow-wrap:anywhere; }
.app-confirm-actions { display:flex; gap:10px; }
.app-confirm-actions button { flex:1; }
.menu-logout { border: 0; background: transparent; color: var(--danger); }
.install-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}

/* Due sheet: reachable action and full-length paginated printing. */
.modal-sheet:has(#print-area) { padding-top: 0; }
.modal-sheet:has(#print-area) .sheet-handle { margin-top: 12px; }
.due-sheet-toolbar { position: sticky; top: 0; z-index: 6; background: white; padding: 10px 0; margin-bottom: 8px; }
.due-sheet-list { display: block; }
.due-sheet-row { gap: 12px; overflow-wrap: anywhere; }
.due-sheet-row > :last-child { flex-shrink: 0; }
@media print {
  @page { size: A4; margin: 12mm; }
  body:has(#modal-overlay.active #print-area) { margin: 0; padding: 0; background: white; height: auto !important; overflow: visible !important; }
  body:has(#modal-overlay.active #print-area) > :not(#modal-overlay) { display: none !important; }
  #modal-overlay.active:has(#print-area) { position: static !important; display: block; opacity: 1; background: none; backdrop-filter: none; height: auto; overflow: visible; }
  #modal-overlay.active:has(#print-area) .modal-sheet { position: static; transform: none !important; transition: none; width: 100%; max-width: none; max-height: none; height: auto; overflow: visible; padding: 0; border-radius: 0; box-shadow: none; }
  #modal-overlay:has(#print-area) .sheet-handle, #modal-overlay:has(#print-area) .sheet-header, .due-sheet-toolbar { display: none !important; }
  #modal-overlay:has(#print-area) #modal-body, #print-area, .due-sheet-list { height: auto; max-height: none; overflow: visible; }
  #print-area > :first-child { break-inside: avoid; }
  .due-sheet-row { break-inside: avoid; page-break-inside: avoid; font-size: 11pt !important; }
  .due-sheet-row > div > div { font-size: 9pt !important; }
}

.direct-customer-search { position: sticky; top: 0; background: white; z-index: 6; padding: 8px 0 12px; }
.direct-customer-search small { display: block; margin-top: 8px; color: #64748b; font-size: .75rem; }
.direct-customer-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 8px; text-align: left; background: white; border: 0; border-bottom: 1px solid #e2e8f0; font: inherit; color: #1e293b; cursor: pointer; }
.direct-customer-result:hover, .direct-customer-result:focus-visible { background: #eff6ff; }
.direct-customer-result > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.direct-customer-result small { display: block; color: #64748b; font-size: .78rem; }
.direct-customer-due { flex-shrink: 0; text-align: right; color: #dc2626; font-size: .8rem; }
.direct-customer-empty { padding: 24px 8px; text-align: center; color: #64748b; }

/* Full-screen forms with an independent scrolling content area. */
@media screen {
  body:has(#modal-overlay.active) { overflow: hidden; }
  .modal-overlay { align-items: stretch; background: white; backdrop-filter: none; }
  #modal-sheet.modal-sheet { display: flex; flex-direction: column; width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding: 0; overflow: hidden; transform: none; transition: none; }
  #modal-sheet .sheet-handle { display: none; }
  #modal-sheet .sheet-header { position: relative; top: auto; z-index: 7; flex-shrink: 0; margin: 0; padding: calc(14px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left)); background: white; border-bottom: 1px solid #e2e8f0; }
  #modal-sheet .sheet-title { flex: 1; }
  #modal-sheet #modal-close-button { flex-shrink: 0; }
  #modal-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px max(18px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
  #modal-sheet.customer-ledger-sheet .sheet-header { background: #f8fafc; }
  .direct-customer-search, .due-sheet-toolbar { top: -16px; padding-top: 16px; }
}

@media screen {
  body:has(#app-container) { overscroll-behavior-y: contain; }
}
.pull-refresh-status { position: fixed; top: calc(72px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 45; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 24px; padding: 10px 18px; font-size: .85rem; box-shadow: 0 4px 12px #0f172a1a; white-space: nowrap; }
.pull-refresh-status[hidden] { display: none; }

/* Anchor mobile navigation directly to the screen edges. */
@media screen and (max-width: 540px) {
  #bottom-nav { position: fixed; inset: auto 0 0; transform: none; width: auto; max-width: none; flex-shrink: 0; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  #bottom-nav .nav-item { min-height: 48px; }
}

@media screen {
  body:not(.logged-in) #bottom-nav, body:not(.logged-in) #main-fab { display: none !important; }
  body.logged-in #bottom-nav { z-index: 60; }
  body.logged-in #modal-sheet.modal-sheet { height: calc(100vh - var(--bottom-nav-height) - env(safe-area-inset-bottom)); height: calc(100dvh - var(--bottom-nav-height) - env(safe-area-inset-bottom)); }
  body.logged-in .modal-overlay { align-items: flex-start; }
}
