/* Author: Nesynov David Viktorovich (Несынов Давид Викторович). (c) 2026 GranaDzyak. All rights reserved. */
/* Переключатель сервисов Граны в шапке */
.svc-btn { flex: 0 0 auto; }
.svc-btn__ic { display: block; }
.svc-open .svc-btn { color: var(--mg-ivory); border-color: var(--mg-border); background: rgba(212, 161, 75, .08); }

.svc-layer { position: fixed; inset: 0; z-index: 1200; }
.svc-pane {
  position: absolute; top: 64px; right: 12px; width: 344px; max-height: calc(100dvh - 90px); overflow-y: auto;
  padding: 14px 12px 12px; border: 1px solid var(--mg-border); border-radius: 18px; background: var(--mg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: svc-in .18s ease-out;
}
@keyframes svc-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.svc-pane__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 10px; }
.svc-pane__title { margin: 0; font: 700 15px/1.2 var(--display, inherit); color: var(--mg-ivory); }
.svc-pane__x {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--mg-copy);
  border: 1px solid transparent; background: none; cursor: pointer;
}
.svc-pane__x:hover { color: var(--mg-ivory); border-color: var(--mg-border); }
.svc-pane__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.svc-pane__empty { grid-column: 1 / -1; margin: 12px 4px; color: var(--mg-muted); font-size: 13px; }
.svc-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px; border-radius: 14px;
  color: var(--mg-copy); text-decoration: none; text-align: center; transition: background .15s, color .15s;
}
.svc-tile:hover, .svc-tile:focus-visible { background: var(--mg-hover); color: var(--mg-ivory); outline: none; }
.svc-tile__ic {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--mg-amber-lite);
  background: radial-gradient(120% 120% at 30% 20%, rgba(242, 138, 45, .22), rgba(168, 67, 36, .1) 60%, transparent),
    var(--mg-alt);
  border: 1px solid var(--mg-border-amber);
}
.svc-tile__ic svg { width: 24px; height: 24px; }
.svc-tile__ic img { width: 28px; height: 28px; object-fit: contain; }
.svc-tile__t { font-size: 12.5px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }

.svc-pane__cfg { display: none; }

@media (max-width: 640px) {
  .topnav__actions .svc-btn { width: 34px; height: 36px; }
  .topnav .tb-pen { display: none; }
  .svc-pane__cfg {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 16px; padding: 13px;
    border: 1px solid var(--mg-border); border-radius: 14px; background: none; color: var(--mg-copy); font: inherit; font-size: 14px; cursor: pointer;
  }
  .svc-pane__cfg svg { width: 16px; height: 16px; }
  .svc-layer { background: var(--mg-card); }
  .svc-pane {
    position: static; width: auto; height: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(20px + env(safe-area-inset-bottom, 0px)); animation: svc-up .2s ease-out;
  }
  @keyframes svc-up { from { opacity: 0; transform: translateY(16px); } }
  .svc-pane__head { padding: 2px 2px 16px; }
  .svc-pane__title { font-size: 19px; }
  .svc-pane__x { width: 42px; height: 42px; border-color: var(--mg-border); }
  .svc-pane__grid { gap: 8px; }
  .svc-tile { padding: 14px 4px 12px; background: var(--mg-alt); }
  .svc-tile__ic { width: 54px; height: 54px; }
  .svc-tile__t { font-size: 13px; }
}
@media (max-width: 640px) {
  html.tb-tight .topnav__actions [data-tb-phn="2"] { display: none !important; }
  html.tb-tight2 .bal-chip .bal-chip__cur--gift { display: none !important; }
  html.tb-tight3 .bal-chip .bal-chip__rank { display: none !important; }
  html.tb-tight4 .topnav__search { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { .svc-pane, .svc-btn__ic { animation: none; transition: none; } }
