/* responsive.css — breakpoints 1440 / 834 / 390 для vibem.ru operatorskaya */

/* Skip-to-content link (a11y) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  z-index: 9999;
  font-weight: 500;
}
.skip-link:focus {
  top: 8px;
}

/* Focus-visible outlines везде */
:focus-visible {
  outline: 2px solid var(--accent-2, #a7a3ff);
  outline-offset: 2px;
  border-radius: 6px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--accent-2, #a7a3ff);
  outline-offset: 2px;
}

/* Tablet: 834-1023px */
@media (max-width: 1023px) {
  .app {
    grid-template-columns: 60px 1fr;
  }
  .sidebar {
    width: 60px;
  }
  .sb-brand-name, .sb-brand-sub, .sb-label, .sb-badge {
    display: none;
  }
  .sb-item {
    justify-content: center;
    padding: 10px 0;
  }
  .sb-item span:not(.sb-badge):not(.dot) {
    display: none;
  }
  .sb-foot {
    padding: 8px;
  }
  .content {
    padding: 24px 20px 60px;
  }
  .hero {
    grid-template-columns: 1fr !important;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dlg-layout {
    grid-template-columns: 260px 1fr !important;
  }
}

/* Mobile: <834px — bottom tab-bar */
@media (max-width: 833px) {
  .app {
    grid-template-columns: 1fr;
    padding-bottom: 56px;
  }
  .sidebar {
    display: none;
  }
  .topbar {
    height: 44px;
    padding: 0 12px;
  }
  .crumbs {
    font-size: 11px;
  }
  .content {
    padding: 16px 14px 80px;
    max-width: 100%;
  }
  .hero, .kpi-grid, .two-col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .dlg-layout {
    grid-template-columns: 1fr !important;
  }
  .dlg-list {
    display: none;
  }
  .dlg-view {
    display: flex !important;
  }
  .int-grid, .pb-grid {
    grid-template-columns: 1fr !important;
  }
  .sch-grid {
    overflow-x: auto;
  }
  .table {
    font-size: 12px;
  }
  .ap-levels {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ap-limits {
    grid-template-columns: 1fr !important;
  }

  /* Bottom tab-bar */
  .mobile-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding: 0 8px;
  }
  .mobile-tabbar .mt-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--fg-dim);
    font-size: 10px;
    cursor: pointer;
    text-align: center;
  }
  .mobile-tabbar .mt-item.active {
    color: var(--accent-2);
  }
  .mobile-tabbar .mt-item svg {
    width: 20px;
    height: 20px;
  }

  /* Modals full-screen on mobile */
  .modal, .cmd {
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
  }

}

/* Mobile bottom sheet (more sections) */
.mobile-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-2, #111113);
  border-top: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 16px 16px 0 0;
  padding: 16px 20px 80px;
  transform: translateY(100%);
  transition: transform 200ms ease-out;
  z-index: 110;
  max-height: 70vh;
  overflow-y: auto;
}
.mobile-sheet.open {
  transform: translateY(0);
}
.mobile-sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 12px;
}
.mobile-sheet-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute, rgba(244,244,245,0.38));
  margin-bottom: 8px;
}
.mobile-sheet-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-sheet-item {
  padding: 14px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--fg, #f4f4f5);
  cursor: pointer;
}
.mobile-sheet-item:hover,
.mobile-sheet-item:focus {
  background: rgba(255,255,255,0.05);
  outline: none;
}

/* Hide mobile tab-bar on desktop */
@media (min-width: 834px) {
  .mobile-tabbar, .mobile-sheet { display: none !important; }
}

/* Small mobile: <480px */
@media (max-width: 479px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .ap-levels {
    grid-template-columns: 1fr !important;
  }
  .kpi-val {
    font-size: 22px !important;
  }
  .hero-quote, .ap-hero h2 {
    font-size: 18px !important;
  }
}

/* Reduce motion for users who prefer */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .pulse { animation: none !important; }
}

/* Print: hide interactive UI */
@media print {
  .sidebar, .topbar, .mobile-tabbar, .tweaks-panel, .toast-stack, button, .stop {
    display: none !important;
  }
  .content {
    padding: 0 !important;
  }
}
