:root{
  --toolbar-h: 64px;
  --toolbar-bg: #0f1419;
  --toolbar-border: rgba(255,255,255,.08);
  --toolbar-fg: rgba(255,255,255,.92);
  --toolbar-muted: rgba(255,255,255,.68);
}

body.has-mobile-toolbar{
  padding-bottom: calc(var(--toolbar-h) + env(safe-area-inset-bottom));
}

.toolbar{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1000;
  background: var(--toolbar-bg);
  border-top: 1px solid var(--toolbar-border);
  padding-bottom: env(safe-area-inset-bottom);
}

.toolbar__container{
  height: var(--toolbar-h);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
}

.toolbar__item{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  background: transparent;
  border: 0;
  color: var(--toolbar-muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.toolbar__item svg{
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.toolbar__item.is-active,
.toolbar__item[aria-current="page"]{
  color: var(--toolbar-fg);
}

.toolbar__item:active{
  transform: translateY(1px);
}

.toolbar .point{
  fill: #ff3b30;
}

/* Overlay panels */
.m-panel{
  position: fixed;
  left: 0; right: 0;
  top: 0;
  bottom: calc(var(--toolbar-h) + env(safe-area-inset-bottom));
  z-index: 999;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.m-panel[hidden]{ display: none; }

.m-panel__header{
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
}

.m-panel__title{
  font-weight: 700;
  font-size: 16px;
}

.m-panel__close{
  border: 0;
  background: rgba(0,0,0,.06);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
}

/* Search */
.m-search{
  padding: 14px;
}

.m-search__field{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 14px;
  padding: 12px 12px;
}

.m-search__icon{ opacity: .7; }

.m-search__input{
  width: 100%;
  border: 0;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.m-search__tabs{
  display: flex;
  gap: 10px;
  margin-top: 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
  padding-bottom: 10px;
}

.m-search__tab{
  border: 0;
  background: rgba(0,0,0,.04);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.m-search__tab.is-active{
  background: rgba(0,0,0,.08);
}

.m-search__count{
  color: #ff3b30;
  margin-left: 4px;
}

.m-search__results{
  padding: 14px 0 26px;
}

.m-search__empty{
  padding: 14px 2px;
  color: rgba(0,0,0,.55);
}

.m-result{
  display: block;
  padding: 12px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

.m-result:hover{ background: rgba(0,0,0,.04); }

.m-result__title{
  font-weight: 600;
  font-size: 14px;
}

.m-result__meta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

/* Contacts */
.m-contacts{
  padding: 14px;
}

.m-contacts__primary{
  display: block;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,.05);
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.m-contacts__grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.m-contacts__item{
  display: block;
  padding: 12px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,.04);
  text-decoration: none;
  color: inherit;
  text-align: center;
  font-weight: 600;
}

.m-contacts__meta{
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
}

.m-contacts__label{
  font-size: 12px;
  color: rgba(0,0,0,.55);
}

.m-contacts__value{
  margin-top: 6px;
  font-weight: 600;
}

/* Show only on mobile */
@media (min-width: 992px){
  body.has-mobile-toolbar{ padding-bottom: 0; }
  .toolbar, .m-panel{ display: none !important; }
}
