/* Modern bottom navigation + service sheet */
:root {
  --mbn-h: 0px;
  --mbn-accent: #00bfa5;
  --mbn-accent-soft: rgba(0, 191, 165, .12);
  --mbn-bg: rgba(255, 255, 255, .96);
  --mbn-text: #6b7280;
  --mbn-text-strong: #111827;
  --mbn-border: rgba(17, 24, 39, .08);
  --mbn-sheet: #fff;
  --mbn-muted: #6b7280;
}

body.has-modern-bottom {
  padding-bottom: var(--mbn-h) !important;
}

.modern-bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1040;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 6px 6px env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--mbn-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--mbn-border);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, .08);
  border-radius: 18px 18px 0 0;
}

.modern-bottom-nav a,
.modern-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--mbn-text);
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border-radius: 14px;
  min-width: 0;
  padding: 4px 2px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.modern-bottom-nav a span,
.modern-bottom-nav button span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.modern-bottom-nav svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex-shrink: 0;
}

.modern-bottom-nav a:hover,
.modern-bottom-nav button:hover,
.modern-bottom-nav a.active,
.modern-bottom-nav button.active {
  color: var(--mbn-accent);
  background: var(--mbn-accent-soft);
}

.modern-bottom-nav a:active,
.modern-bottom-nav button:active {
  transform: scale(.96);
}

.mbn-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mbn-sheet-backdrop[hidden],
.mbn-sheet-backdrop.d-none {
  display: none !important;
}

.mbn-sheet {
  width: min(560px, 100%);
  max-height: min(82vh, 740px);
  overflow: auto;
  background: var(--mbn-sheet);
  border-radius: 22px 22px 0 0;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--mbn-border);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, .18);
  animation: mbnUp .28s ease;
  color: var(--mbn-text-strong);
}

@keyframes mbnUp {
  from { transform: translateY(28px); opacity: .55; }
  to { transform: translateY(0); opacity: 1; }
}

.mbn-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .18);
  margin: 4px auto 6px;
}

.mbn-sheet h3 {
  margin: 0 4px 2px;
  font-size: 1rem;
  font-weight: 700;
}

.mbn-sheet-group {
  margin: .55rem 4px 0;
  font-size: .78rem;
  color: var(--mbn-accent);
  font-weight: 700;
}

.mbn-sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--mbn-border);
  color: inherit;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.mbn-sheet-item:hover {
  background: var(--mbn-accent-soft);
  border-color: rgba(0, 191, 165, .28);
  color: inherit;
}

.mbn-sheet-item img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.mbn-sheet-item strong {
  display: block;
  font-size: .9rem;
  font-weight: 600;
}

.mbn-sheet-item span {
  display: block;
  font-size: .72rem;
  color: var(--mbn-muted);
  margin-top: 2px;
}

.mbn-sheet-close {
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--mbn-muted);
  padding: 12px;
  cursor: pointer;
  border-radius: 12px;
}

.mbn-sheet-close:hover {
  background: #f3f4f6;
  color: var(--mbn-text-strong);
}

/* Slim top header actions */
.slim-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.slim-credit {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #f0fdfa;
  border: 1px solid rgba(0, 191, 165, .25);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.slim-credit img {
  width: 18px;
  height: 18px;
}

.slim-charge-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--mbn-accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.slim-charge-btn:hover {
  filter: brightness(.95);
  color: #fff !important;
}

.slim-auth-btn {
  display: inline-flex;
  align-items: center;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: #111827;
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.slim-logout-btn {
  display: inline-flex;
  align-items: center;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: #fff;
  color: #dc2626 !important;
  border: 1px solid rgba(220, 38, 38, .35);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  :root { --mbn-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 1199.98px) {
  :root { --mbn-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
