:root {
  --bg: #f7f7f5;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e0;
  --accent: #C9A227;
  --accent-ink: #0A2540;
  --danger: #9b1c1c;
  --ok: #0f6e56;
  --radius: 6px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "IBM Plex Sans", "Segoe UI", sans-serif;
  --max: 960px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header, .app-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.site-header { position: relative; z-index: 40; }
.site-footer {
  margin-top: 3rem;
  border-top: 0;
  background:
    linear-gradient(180deg, rgba(10, 37, 64, 0.03) 0%, rgba(10, 37, 64, 0.055) 100%),
    #f4f5f3;
  color: var(--ink);
}
.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-ink, #0A2540) 0%, var(--accent, #C9A227) 55%, transparent 100%);
}
.header-inner, .app-header, .container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}
.footer-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.15rem 1.25rem 1.1rem;
}
.site-footer .footer-grid,
.footer-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  width: 100%;
}
.footer-col {
  min-width: 0;
}
.footer-col--brand {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
  max-width: 58%;
}
.footer-brand__logo {
  display: block;
  height: 1.85rem;
  width: auto;
  max-width: 9rem;
  object-fit: contain;
  object-position: left center;
}
.footer-brand__name {
  display: block;
  font-family: var(--display), var(--font), sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-ink, #0A2540);
}
.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-contact__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}
a.footer-contact__item:hover {
  color: var(--accent-ink, #0A2540);
  text-decoration: none;
}
a.footer-contact__item:hover .footer-contact__ico {
  border-color: rgba(201, 162, 39, 0.55);
  color: var(--accent-ink, #0A2540);
}
.footer-contact__ico {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: linear-gradient(160deg, #0A2540 0%, #163a5c 100%);
  color: #f0d78a;
}
.footer-contact__ico svg { display: block; }
.footer-contact__item > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.footer-col--legal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  text-align: right;
  flex: 0 1 auto;
  margin-left: auto;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  margin: 0;
}
.footer-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.footer-links a:hover {
  color: var(--accent-ink, #0A2540);
  text-decoration: none;
}
.footer-copy {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.fn-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.55rem 0.28rem 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 37, 64, 0.12);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fn-credit:hover {
  text-decoration: none;
  border-color: #d4b45a;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.07);
}
.fn-credit__mark {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #1a3a5c 0%, var(--accent-ink, #0A2540) 100%);
  color: #f0d78a;
  font-family: var(--display), Georgia, serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: -0.04em;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.3);
}
.fn-credit__by {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
}
.fn-credit__name {
  font-family: var(--display), var(--font), Georgia, serif;
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--accent-ink, #0A2540);
}
@media (max-width: 720px) {
  .site-footer .footer-grid,
  .footer-grid {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .footer-col--brand {
    max-width: none;
  }
  .footer-col--legal {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(10, 37, 64, 0.1);
  }
  .footer-links { justify-content: flex-start; }
}
.shop-location {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin: 0 0 1.15rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.loc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 10rem;
}
.loc-field select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  background: #fff;
  min-width: 11rem;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: nowrap;
  min-height: 56px;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand-logo { display: inline-flex; align-items: center; }
.site-logo { height: 42px; width: auto; display: block; }
.site-logo-auth { height: 56px; margin: 0 auto 1rem; }
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-left: auto;
  min-width: 0;
  flex: 1 1 auto;
}
.header-auth {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  margin-left: auto;
}
.header-auth-link {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.header-auth-link:hover { color: var(--accent); text-decoration: none; }
.nav { display: flex; gap: 1rem; flex-wrap: nowrap; align-items: center; }
.nav a { color: var(--ink); font-size: 0.95rem; }
.main { min-height: 55vh; }
.site-footer .muted, .muted { color: var(--muted); font-size: 0.9rem; }
.hero-min { padding: 2.5rem 0 1.5rem; }
.hero-min h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.hero-min p { color: var(--muted); max-width: 36rem; margin: 0 0 1.25rem; }
.search { display: flex; gap: 0.5rem; max-width: 28rem; margin-bottom: 1rem; }
.search-shop {
  max-width: none;
  width: 100%;
  margin-bottom: 1.25rem;
}
.search-shop input {
  flex: 1;
  min-width: 0;
}
.shop-page h1 { margin: 0 0 0.75rem; font-size: 1.5rem; }
.shop-cats { margin-bottom: 1.25rem; }
.shop-count { margin: 0 0 1rem; }
.search input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
}
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(0.95); text-decoration: none; color: var(--accent-ink); }
.btn-outline {
  background: transparent;
  color: var(--accent);
}
.btn-outline:hover { color: var(--accent); }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.cats h2, .section-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.65rem;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
/* Compact 4-column category tiles (icon + label) */
.cat-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}
.cat-card,
.cat-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.35rem;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
}
.cat-card:hover,
.cat-grid a:hover { border-color: var(--accent); text-decoration: none; }
.cat-card.on,
.cat-grid a.on {
  border-color: var(--accent);
  background: #fffdf5;
  color: var(--accent-ink);
}
.cat-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
  hyphens: auto;
}
.cat-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.cat-icon-ph {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eee;
}
.cat-icon-all {
  background: linear-gradient(135deg, #f3eee0, #e8e8e4);
}
.cat-icon-admin {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
}
.cat-pill-icon {
  vertical-align: middle;
  margin-right: 0.25rem;
  border-radius: 4px;
}
.cat-pills a {
  display: inline-flex;
  align-items: center;
}
/* PWA install — Pocket Church–style overlay + card */
.tk-pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.tk-pwa-modal[hidden] { display: none !important; }
.tk-pwa-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tk-pwa-modal.is-open .tk-pwa-modal__scrim { opacity: 1; }
.tk-pwa-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: #fff;
  color: #111;
  border-radius: 16px;
  padding: 24px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transform: translateY(18px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.tk-pwa-modal.is-open .tk-pwa-modal__dialog {
  transform: translateY(0);
  opacity: 1;
}
.tk-pwa-modal__dialog h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
}
.tk-pwa-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
}
.tk-pwa-modal__close:hover { color: #111; }
.tk-pwa-modal__dialog.tk-pwa-prompt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 44px 16px 14px;
  border: 0;
}
.tk-pwa-prompt-card__icon img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}
.tk-pwa-prompt-card__body {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.tk-pwa-prompt-card__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
}
.tk-pwa-prompt-card__btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--tk-pwa-theme, var(--accent, #C9A227));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tk-pwa-prompt-card__btn:hover { filter: brightness(0.95); }
.tk-pwa-steps {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.55;
  font-size: 15px;
  color: #222;
}
.tk-pwa-note {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.45;
}
body.tk-pwa-lock { overflow: hidden; }
@media (min-width: 600px) {
  .tk-pwa-modal { align-items: center; }
}

/* PWA splash (standalone launch) */
.tk-pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tk-splash-bg, var(--bg, #f7f7f5));
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.tk-pwa-splash[hidden] { display: none !important; }
.tk-pwa-splash.is-hiding {
  opacity: 0;
  pointer-events: none;
}
html.tk-splash-active,
html.tk-splash-active body {
  overflow: hidden;
}
.tk-pwa-splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  max-width: 90vw;
  text-align: center;
  animation: tk-splash-in 0.45s ease both;
}
@keyframes tk-splash-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.tk-pwa-splash__logo,
.tk-pwa-splash__img {
  display: block;
  max-width: min(220px, 55vw);
  max-height: min(220px, 40vh);
  width: auto;
  height: auto;
  object-fit: contain;
}
.tk-pwa-splash__img {
  max-width: min(320px, 85vw);
  max-height: min(420px, 70vh);
}
.tk-pwa-splash__name,
.tk-pwa-splash__fallback {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink, #111);
  letter-spacing: 0.02em;
}
.tk-pwa-splash__html {
  width: min(420px, 92vw);
  max-height: 80vh;
  overflow: auto;
}
.home-ads {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.home-ad {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}
.home-ad img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.home-ad-title {
  display: block;
  padding: 1rem;
  font-weight: 600;
}
.analytics-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 120px;
  padding: 0.5rem 0 1.5rem;
  overflow-x: auto;
}
.analytics-bar {
  flex: 1;
  min-width: 1.1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}
.analytics-bar span {
  display: block;
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}
.analytics-bar em {
  position: absolute;
  bottom: -1.25rem;
  font-style: normal;
  font-size: 0.65rem;
  color: var(--muted);
  white-space: nowrap;
}
.sep { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.cat-grid a:hover { border-color: var(--accent); }
.note { margin-top: 2rem; padding: 1rem; border-left: 3px solid var(--accent); background: #fff; }
.stack { display: flex; flex-direction: column; gap: 0.85rem; max-width: 22rem; }
.stack label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.stack input[type="text"],
.stack input[type="email"],
.stack input[type="password"] {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.check { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.plain { padding-left: 1.1rem; }
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin: 0.75rem 0; }
.flash-success { background: #e8f5f0; color: var(--ok); }
.flash-error { background: #fde8e8; color: var(--danger); }
.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #e8f5f0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.empty { color: var(--muted); padding: 2rem 0; }
.auth-wrap { max-width: 26rem; margin: 2rem auto; padding: 0 1.25rem; }
.auth-card .brand.center { display: block; text-align: center; margin-bottom: 1.25rem; color: var(--ink); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
form.inline { display: inline; margin: 0; }
button.linkish {
  background: none; border: 0; color: var(--ink); font: inherit; cursor: pointer; padding: 0;
  text-decoration: underline;
}
/* —— Hamburger / mobile storefront menu —— */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
  margin-left: auto;
  z-index: 95;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  pointer-events: none;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }
.menu-close {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.menu-close.light { color: #eee; }
.nav-drawer-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.dash-nav .nav-drawer-head {
  display: flex;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 1.25rem;
}
.dash-nav-head {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
.dash-nav:not(.dark) .dash-nav-head {
  border-bottom-color: var(--line);
}
.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(10, 37, 64, 0.45);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
body.nav-open .nav-scrim,
body.dash-nav-open .nav-scrim { display: block; }
body.nav-open,
body.dash-nav-open { overflow: hidden; }

.dash-body { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; margin: 0; }
.dash-nav {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 1.25rem 1rem;
}
.dash-nav.dark { background: #111; color: #eee; border-right: 0; }
.dash-nav .brand { display: block; margin-bottom: 0; color: inherit; text-decoration: none; }
.dash-nav a { color: var(--ink); display: block; padding: 0.4rem 0; }
.dash-nav.dark a { color: #ccc; }
.dash-nav.dark a:hover { color: #fff; }
.dash-nav a.muted { opacity: 0.55; pointer-events: none; }

/* Admin: always hamburger drawer (all viewports) */
.dash-body.admin {
  grid-template-columns: 1fr;
}
.dash-body.admin .dash-menu-toggle {
  display: inline-flex;
  margin-left: 0;
  margin-right: 0.35rem;
}
.dash-body.admin .dash-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 86vw);
  z-index: 100;
  margin: 0;
  padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-right: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 12px 0 40px rgba(10, 37, 64, 0.18);
}
.dash-body.admin .dash-nav.is-menu-open {
  display: block;
}
.dash-body.admin .dash-nav .nav-drawer-head {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.dash-body.admin .dash-nav .menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dash-body.admin .dash-nav nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.dash-body.admin .dash-nav a {
  padding: 0.75rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dash-body.admin .dash-top {
  gap: 0.65rem;
}
.dash-main { padding: 0 1.25rem 2rem; background: var(--bg); }
.dash-top { padding: 1rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1rem; display: flex; gap: 0.5rem; align-items: center; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar h1 { margin: 0; font-size: 1.35rem; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-n { font-size: 1.5rem; font-weight: 650; }

.dash-icon-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}
.dash-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 104px;
  padding: 0.85rem 0.5rem;
  text-align: center;
  text-decoration: none !important;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-sizing: border-box;
}
.dash-icon-btn:hover {
  border-color: var(--accent);
  text-decoration: none !important;
  color: var(--ink);
}
.dash-icon-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f3eee0;
  color: var(--accent);
  flex-shrink: 0;
}
.dash-icon-btn__icon svg {
  display: block;
  width: 28px;
  height: 28px;
}
.dash-icon-btn__label {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}
.dash-icon-btn__meta {
  font-size: 0.75rem;
  color: var(--muted, #666);
  font-weight: 600;
}
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.stack.wide { max-width: 36rem; }
.stack textarea, .stack select, .row-form select, .row-form input {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}
.stack textarea { resize: vertical; }
.inline-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  max-width: none;
  margin-bottom: 1.5rem;
  gap: 0.75rem;
}
.inline-form label { min-width: 8rem; }
.row-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.badge-warn { background: #fde8e8; color: var(--danger); }
.targets { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; background: #fff; }
.targets legend { padding: 0 0.35rem; font-weight: 600; }
.danger-zone { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.key-reveal .key { display: block; margin-top: 0.5rem; word-break: break-all; font-size: 0.95rem; }
.client-card { display: flex; flex-direction: column; gap: 0.65rem; padding: 0.25rem 0; }
.client-fields, .client-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.client-fields input { min-width: 10rem; flex: 1; }
code { font-size: 0.85em; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}
.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 0.65rem;
  min-width: 0;
}
.product-card:hover { border-color: var(--accent); text-decoration: none; }
.product-card img, .product-ph {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #e8e8e4;
  display: block;
}
.product-name {
  font-weight: 600;
  padding: 0 0.55rem;
  font-size: 0.85rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price { padding: 0 0.55rem; color: var(--accent); font-weight: 600; font-size: 0.88rem; }
.product-meta {
  padding: 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .product-name { font-size: 0.95rem; padding: 0 0.75rem; }
  .product-price, .product-meta { padding: 0 0.75rem; }
  .product-meta { font-size: 0.8rem; }
}
@media (min-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.cat-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.cat-pills a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  font-size: 0.9rem;
}
.cat-pills a.on, .cat-pills a:hover { border-color: var(--accent); color: var(--accent); }
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
}
.product-hero { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.price-lg { font-size: 1.35rem; font-weight: 650; color: var(--accent); }
.product-section h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pwa-hint { margin-top: 1.5rem; font-size: 0.85rem; }
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at top left, rgba(201, 162, 39, 0.18), transparent 45%),
    radial-gradient(ellipse at bottom right, rgba(10, 37, 64, 0.12), transparent 40%),
    var(--bg);
}
.auth-card {
  width: min(100%, 26rem);
  margin: 1.5rem auto;
  padding: 1.5rem 1.35rem 1.75rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(10, 37, 64, 0.08);
}
.auth-card h1 { margin: 0 0 0.35rem; font-size: 1.4rem; letter-spacing: -0.02em; }
/* —— Mobile / PWA bottom tab bar (never on desktop website) —— */
.site-tabbar {
  display: none !important;
}
.tab-ico-img { display: block; width: 22px; height: 22px; object-fit: contain; }
.tabbar-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  line-height: 1rem;
  text-align: center;
  font-weight: 700;
}
@media (min-width: 861px) {
  .site-tabbar { display: none !important; }
  body.has-tabbar { padding-bottom: 0; }
  body.has-tabbar .site-header .nav { display: flex; }
  body.has-tabbar .site-footer { display: block; }
}
@media (max-width: 860px), (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
  /* Public site: logo + auth same row; modules via bottom tabs */
  .header-inner { flex-wrap: nowrap !important; }
  .header-right {
    margin-left: auto !important;
    gap: 0.5rem;
    flex: 1 1 auto;
    justify-content: flex-end;
  }
  body.has-tabbar .site-header .nav { display: none !important; }
  body.has-tabbar .header-auth { display: flex !important; margin-left: auto; }
  .header-auth .btn-sm { padding: 0.35rem 0.65rem; white-space: nowrap; }
  body.has-tabbar {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
  body.has-tabbar .site-footer { display: block; }
  .site-tabbar {
    display: flex !important;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(10, 37, 64, 0.06);
  }
  .tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.35rem 0.2rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.1;
  }
  .tabbar-item:hover { text-decoration: none; color: var(--ink); }
  .tabbar-item.is-active { color: var(--accent-ink); }
  .tabbar-item.is-active .tab-ico { color: var(--accent); }
  .tabbar-ico {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
  }
  .tabbar-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Vendor hamburger drawer on small screens (admin always hamburger via .admin rules) */
  .dash-body:not(.admin) { grid-template-columns: 1fr; }
  .dash-body:not(.admin) .dash-menu-toggle { display: inline-flex; margin-left: 0; margin-right: 0.35rem; }
  .dash-body:not(.admin) .dash-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 86vw);
    z-index: 100;
    margin: 0;
    padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    border-right: 1px solid var(--line);
    border-bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 12px 0 40px rgba(10, 37, 64, 0.14);
  }
  .dash-body:not(.admin) .dash-nav.is-menu-open { display: block; }
  .dash-body:not(.admin) .dash-nav .nav-drawer-head {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
  }
  .dash-body:not(.admin) .dash-nav .menu-close { display: inline-flex; align-items: center; justify-content: center; }
  .dash-body:not(.admin) .dash-nav .brand { margin: 0; }
  .dash-body:not(.admin) .dash-nav nav { display: flex; flex-direction: column; gap: 0.1rem; }
  .dash-body:not(.admin) .dash-nav a {
    display: block;
    padding: 0.75rem 0.35rem;
    border-bottom: 1px solid var(--line);
  }
  .dash-top { gap: 0.65rem; }
  .product-detail { grid-template-columns: 1fr; }
}
/* Desktop browser always wins over display-mode when wide */
@media (min-width: 861px) and (display-mode: browser) {
  .site-tabbar { display: none !important; }
  body.has-tabbar { padding-bottom: 0 !important; }
  body.has-tabbar .site-header .nav { display: flex !important; }
  body.has-tabbar .site-footer { display: block !important; }
  .header-right {
    display: flex !important;
    align-items: center;
    gap: 1.15rem;
    margin-left: auto !important;
  }
  /* Vendor keeps sidebar on wide desktop; admin stays hamburger */
  body.dash-body:not(.admin) {
    grid-template-columns: 200px 1fr !important;
  }
  body.dash-body:not(.admin) .dash-nav {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 1.25rem 1rem !important;
  }
  body.dash-body:not(.admin) .dash-nav .nav-drawer-head {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 1.25rem !important;
  }
  body.dash-body:not(.admin) .dash-nav a {
    border-bottom: 0 !important;
    padding: 0.4rem 0 !important;
  }
  body.dash-body:not(.admin) .dash-menu-toggle {
    display: none !important;
  }
  body.dash-body.admin {
    grid-template-columns: 1fr !important;
  }
  body.dash-body.admin .dash-menu-toggle {
    display: inline-flex !important;
  }
  body.dash-body.admin .dash-nav {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(300px, 86vw) !important;
    z-index: 100 !important;
    padding: 1rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 12px 0 40px rgba(10, 37, 64, 0.18) !important;
    overflow-y: auto !important;
  }
  body.dash-body.admin .dash-nav.is-menu-open {
    display: block !important;
  }
}
