/* Thanh điều hướng dưới màn hình — chỉ hiện trong app đã cài (chế độ standalone) và chỉ khi đã đăng nhập quản trị.
   Màu cố định (không theo theme trang) để giống nhau trên trang trắng, trang xanh rêu, trang đỏ nhung. */
.tabbar {
  --tb-bg: rgba(255, 255, 255, .94);
  --tb-fg: #6f6a62;
  --tb-active: #1f1c18;
  --tb-accent: #a5824a;
  --tb-line: rgba(31, 28, 24, .1);
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--tb-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--tb-line);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  .tabbar.adapt { --tb-bg: rgba(26, 37, 30, .94); --tb-fg: #a3ab9b; --tb-active: #eef0e8; --tb-accent: #d2b46b; --tb-line: rgba(255,255,255,.1); }
}
.tabbar a {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px 4px; border-radius: 12px;
  color: var(--tb-fg); text-decoration: none;
  font-size: 11px; font-weight: 500; letter-spacing: .01em; line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--tb-active); font-weight: 600; }
.tabbar a[aria-current="page"] svg { color: var(--tb-accent); }
.tabbar a:active { background: var(--tb-line); }
.tabbar a:focus-visible { outline: 2px solid var(--tb-accent); outline-offset: -2px; }

/* Hiện trong app: theo media query, và lớp .is-app do app.js gắn (dự phòng cho iPhone) */
@media (display-mode: standalone) {
  .tabbar { display: flex; }
  body:has(.tabbar) { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .admin-bar { display: none; }            /* thanh quản trị ở đầu trang chủ: đã có thanh dưới */
}
.is-app .tabbar { display: flex; }
.is-app body:has(.tabbar) { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.is-app .admin-bar { display: none; }

/* Đang xem ảnh lớn thì ẩn thanh */
body:has(.lb:not([hidden])) .tabbar { display: none; }
