/* Mobile-first repair layer. Loaded from the App Router template for every route. */
.mobile-nav-toggle { display: none; }

@media (max-width: 700px) {
  html { scroll-padding-top: 72px; }
  body { min-width: 320px; overflow-x: hidden; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  button, .contact-chip, .price-more, .map-route { min-height: 44px; }

  .page-canvas.home-page,
  .page-canvas.sub-page { width: 100% !important; height: auto !important; min-height: 0 !important; transform: none !important; overflow: visible !important; }
  .site-scale { width: 100% !important; height: auto !important; overflow: visible !important; }

  .home-page .hero,
  .sub-page .hero { height: 690px !important; }
  .home-page .hero-photo,
  .sub-page .hero-photo { width: 100% !important; height: 690px !important; background-position: 62% center !important; }

  .mobile-nav-toggle {
    position: absolute; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: repeat(3, 5px);
    align-items: center; column-gap: 10px; left: 16px; top: 18px; z-index: 30;
    width: 96px; min-height: 46px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.34);
    border-radius: 13px; background: rgba(12,12,12,.72); color: #fff; backdrop-filter: blur(12px);
  }
  .mobile-nav-toggle span { grid-column: 1; display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); transition: transform .25s ease, opacity .2s ease; }
  .mobile-nav-toggle b { grid-column: 2; grid-row: 1 / 4; font-size: 12px; font-weight: 700; text-transform: uppercase; }
  .mobile-nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .mobile-nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .home-page .top-nav,
  .sub-page .top-nav {
    position: absolute !important; left: 16px !important; right: 16px !important; top: 72px !important; z-index: 29 !important;
    display: grid !important; grid-template-columns: 1fr 1fr !important; width: auto !important; height: auto !important;
    max-height: 0 !important; padding: 0 !important; overflow: hidden !important; border: 0 !important;
    border-radius: 16px !important; background: rgba(10,10,10,.96) !important; box-shadow: 0 22px 55px rgba(0,0,0,.38);
    opacity: 0; transform: translateY(-8px); pointer-events: none;
    transition: max-height .32s ease, padding .32s ease, opacity .2s ease, transform .32s ease;
  }
  .home-page .top-nav.is-open,
  .sub-page .top-nav.is-open { max-height: 340px !important; padding: 8px !important; opacity: 1; transform: none; pointer-events: auto; }
  .home-page .top-nav a,
  .sub-page .top-nav a { min-width: 0 !important; min-height: 50px; padding: 0 8px !important; border: 0 !important; border-radius: 10px; font-size: 13px !important; text-align: center; }

  .home-page .brand-lockup,
  .sub-page .brand-lockup { left: auto !important; right: 16px !important; top: 22px !important; gap: 0 !important; }
  .home-page .brand-lockup img,
  .sub-page .brand-lockup img { width: 112px !important; }
  .home-page .brand-lockup span,
  .sub-page .brand-lockup span { display: none !important; }

  .home-page .hero-title { top: 142px !important; left: 18px !important; right: 18px !important; }
  .home-page .hero-title h1 { font-size: clamp(31px, 8.8vw, 40px) !important; overflow-wrap: normal; }
  .home-page .hero-title p { font-size: 15px !important; line-height: 1.3 !important; }
  .home-page .hero-actions { top: 400px !important; }
  .sub-page .hero-actions { top: 270px !important; }
  .home-page .hero-actions,
  .sub-page .hero-actions { left: 16px !important; width: calc(100% - 32px) !important; gap: 10px !important; }
  .home-page .contact-chip,
  .sub-page .contact-chip { width: 100% !important; height: 58px !important; border-radius: 14px !important; }
  .home-page .contact-chip .chip-text,
  .sub-page .contact-chip .chip-text { margin-left: 66px !important; font-size: 16px !important; }
  .home-page .contact-booking,
  .sub-page .contact-booking { justify-content: center !important; }
  .home-page .contact-booking .chip-text,
  .sub-page .contact-booking .chip-text { margin-left: 0 !important; }
  .home-page .phone-menu,
  .sub-page .phone-menu { top: 204px !important; z-index: 60 !important; width: 100% !important; background: rgba(34,34,34,.94) !important; }
  .home-page .hero,
  .sub-page .hero { z-index: 4; overflow: visible !important; }
  .home-page .hero-actions,
  .sub-page .hero-actions { z-index: 50 !important; }
  .home-page .hero:has(.contact-phone.is-open) .down-dot,
  .sub-page .hero:has(.contact-phone.is-open) .down-dot { opacity: 0; pointer-events: none; }

  .home-page .facts { grid-template-columns: 1fr !important; padding: 50px 16px 18px !important; }
  .home-page .yellow-card { min-height: 155px !important; }
  .home-page .yellow-card p { max-width: 75%; }
  .home-page .service-pill { padding: 0 58px 0 70px !important; text-align: center; }
  .home-page .quality { min-height: 300px; }
  .home-page .quality h2 { left: 118px !important; right: 16px !important; top: 70px !important; font-size: 24px !important; }
  .home-page .wrench { left: -92px !important; }
  .home-page .about-strip { min-height: 355px !important; }

  .sub-page .text-block,
  .sub-page .adv-section,
  .sub-page .contacts-block { padding-left: 18px !important; padding-right: 18px !important; }
  .sub-page .text-block h1,
  .sub-page .text-block h2,
  .sub-page .adv-section h2,
  .sub-page .contacts-block h1 { font-size: clamp(30px, 8.5vw, 38px) !important; overflow-wrap: anywhere; }
  .sub-page .text-block p { font-size: 16px !important; line-height: 1.45 !important; }
  .about-page .adv-grid article { min-height: 240px !important; }
  .about-page .adv-grid span,
  .about-page .adv-grid article:nth-child(n) span { margin-top: 70px !important; }
  .about-page .about-cta { height: 450px !important; }
  .about-page .about-cta h2 { top: 68px !important; }
  .about-page .about-cta button { top: 265px !important; height: 68px !important; font-size: 22px !important; }

  .services-page .service-catalog { padding-left: 14px !important; padding-right: 14px !important; }
  .services-page .price-card { height: auto !important; min-height: 300px !important; }
  .services-page .price-card b { position: relative !important; left: auto !important; top: auto !important; display: block; margin: 105px 18px 0; }
  .services-page .price-card p { position: relative !important; left: auto !important; top: auto !important; display: block; margin: 18px 18px 84px; }
  .services-page .services-cta { height: auto !important; min-height: 690px; padding-bottom: 54px !important; }
  .services-page .services-cta h2 { top: 62px !important; }
  .services-page .services-cta p { top: 205px !important; }
  .services-page .services-booking-form { top: 355px !important; }

  .gallery-page .gallery-title { padding-top: 44px !important; }
  .gallery-page .gallery-strip { height: 300px !important; margin-top: 28px !important; }
  .gallery-page .gallery-track img,
  .gallery-page .gallery-track img:hover { flex-basis: 88vw !important; width: 88vw !important; height: 300px !important; }

  .faq-page .faq-list { padding: 28px 14px 48px !important; }
  .faq-page .faq-list button,
  .faq-page .faq-list article:nth-child(n) button { padding: 17px 52px 17px 18px !important; text-align: left; }
  .faq-page .faq-list button::after { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); }

  .sub-page .map-section,
  .home-page .map-section { height: 680px !important; }
  .sub-page .map-section h2,
  .home-page .map-section h2 { margin: 58px 16px 14px !important; font-size: 29px !important; }
  .sub-page .map-section .real-map,
  .home-page .real-map { left: 12px !important; top: 292px !important; width: calc(100% - 24px) !important; height: 340px !important; border-radius: 18px; }
  .contacts-page .contacts-map { height: 390px !important; padding: 0 12px !important; }
  .contacts-page .contacts-map .real-map { width: 100% !important; height: 360px !important; border-radius: 18px; }
  .contacts-page .contacts-block dd { font-size: clamp(18px, 5.5vw, 24px) !important; }
  .sub-page .footer,
  .home-page .footer { padding: 28px 18px 42px !important; gap: 20px !important; }
  .sub-page .footer a,
  .home-page .footer a { overflow-wrap: anywhere; }

  .booking-modal { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) !important; }
  .booking-dialog { width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px) !important; padding: 58px 16px 24px !important; border-radius: 22px !important; }
  .booking-dialog h2 { padding-right: 44px !important; font-size: 26px !important; }
  .booking-layout { gap: 22px !important; }
  .calendar-week, .calendar-days { gap: 3px !important; }
  .calendar-days button, .calendar-days span { height: 40px !important; }
  .time-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 7px !important; }
  .booking-details > .booking-field { min-height: 68px !important; }
  .booking-details .booking-file { height: 110px !important; }
  .modal-close { position: sticky !important; float: right; top: 0 !important; right: 0 !important; margin-top: -46px; }
}

/* Tablet administration: sidebar becomes a compact header. */
@media (max-width: 980px) {
  .app-view { display: block !important; }
  .sidebar { position: relative !important; height: auto !important; padding: 18px !important; }
  .sidebar-actions { margin-bottom: 12px !important; }
  .sidebar h1 { font-size: 30px !important; }
  .sidebar p { margin: 8px 0 14px; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0,1fr)); margin-top: 12px !important; }
  .nav-button { text-align: center !important; padding: 8px !important; }
  .workspace { padding: 16px !important; }
}

@media (max-width: 620px) {
  .login-view { padding: 12px !important; }
  .login-card { padding: 26px 20px !important; border-radius: 16px !important; }
  .login-card h1 { font-size: 34px !important; }
  .sidebar { padding: 14px !important; }
  .sidebar h1 { font-size: 26px !important; }
  .sidebar p { display: none; }
  .sidebar .primary { min-height: 46px; }
  .sidebar nav { gap: 6px !important; overflow-x: auto; padding-bottom: 2px; }
  .nav-button { min-width: 108px; font-size: 12px; }
  .workspace { padding: 10px !important; }
  .topbar { grid-template-columns: repeat(3, minmax(0,1fr)) !important; gap: 7px !important; }
  .stat { min-height: 66px !important; padding: 10px !important; }
  .stat span { font-size: 25px !important; }
  .stat small { font-size: 9px; }
  .admin-search, .filter-date { grid-column: 1 / -1 !important; }
  .schedule-head, .orders-head { align-items: flex-start !important; flex-direction: column !important; gap: 12px; padding: 14px !important; }
  .schedule-head h2, .orders-head h2, #clientsView h2 { font-size: 22px !important; }
  .legend { gap: 7px !important; font-size: 11px !important; }
  .schedule-grid { grid-template-columns: 58px minmax(0,1fr) !important; }
  .time-cell { padding: 10px 6px !important; font-size: 12px; }
  .slot-cell { padding: 7px !important; }
  .order-card { padding: 9px !important; }
  .list-row { gap: 8px !important; padding: 14px !important; }
  .order-panel { width: 100% !important; border: 0 !important; }
  #orderForm { padding: 14px !important; padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  .panel-head h2 { font-size: 27px !important; }
  fieldset { padding: 12px !important; }
  .two, .three, .item-row { grid-template-columns: 1fr !important; }
  .item-row button { min-height: 42px; }
  .panel-actions { grid-template-columns: 1fr !important; padding-bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 370px) {
  .home-page .hero-title h1 { font-size: 29px !important; }
  .home-page .hero-actions { top: 390px !important; }
  .home-page .yellow-card { min-height: 145px !important; }
  .topbar { grid-template-columns: 1fr !important; }
  .stat { display: flex; align-items: center; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-toggle span, .top-nav { transition: none !important; }
}

.modal-open .support-chat { opacity: 0 !important; pointer-events: none !important; transform: translateY(12px); }

/* Updated exported components and discrete gallery pages */
@media (max-width: 700px) {
  .home-page .yellow-card.design-export { min-height: 0 !important; aspect-ratio: 344 / 339; }
  .home-page .yellow-card.design-export img { width: 100% !important; height: 100% !important; }
  .home-page .service-pill.design-export { padding: 0 !important; }
  .home-page .service-pill.design-export img { width: 100% !important; height: 100% !important; }
  .about-page .adv-grid article.design-export { min-height: 0 !important; height: auto !important; aspect-ratio: 452 / 549; }
  .about-page .adv-grid article.design-export img { width: 100% !important; height: 100% !important; }

  .gallery-page .gallery-strip { display: block !important; height: 390px !important; margin-top: 28px !important; padding: 0 !important; overflow: visible !important; }
  .gallery-page .gallery-viewport { position: relative !important; left: auto !important; top: auto !important; width: 100% !important; height: 300px !important; border-radius: 0 !important; box-shadow: none; }
  .gallery-page .gallery-track { display: flex !important; width: 100% !important; height: 100% !important; }
  .gallery-page .gallery-slide { flex: 0 0 100% !important; width: 100% !important; height: 300px !important; }
  .gallery-page .gallery-slide img,
  .gallery-page .gallery-slide img:hover { width: 100% !important; height: 300px !important; object-fit: cover !important; }
  .gallery-page .gallery-slide figcaption { padding: 54px 18px 18px; font-size: 16px; }
  .gallery-page .gallery-arrow { top: 316px !important; display: grid !important; width: 48px !important; height: 48px !important; }
  .gallery-page .gallery-arrow.left { left: calc(50% - 60px) !important; }
  .gallery-page .gallery-arrow.right { left: calc(50% + 12px) !important; }
  .gallery-page .gallery-arrow img { width: 48px !important; height: 48px !important; }
  .gallery-page .gallery-pagination { left: 16px !important; top: 372px !important; gap: 6px; }
  .gallery-page .gallery-pagination button { width: 18px; height: 4px; }
  .gallery-page .gallery-pagination button.active { width: 34px; }
  .gallery-page .gallery-counter { right: 16px !important; top: 361px !important; font-size: 13px; }
  .gallery-page .gallery-counter b { font-size: 22px; }
}
/* Mobile companions for the exact Figma desktop exports */
@media (max-width: 700px) {
  .page-canvas .hero > .white-curve,
  .home-page .service-band > .white-curve {
    position: absolute;
    display: block !important;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 32px;
    border-radius: 0;
    clip-path: none !important;
    background: url("/assets/section-curve-exact.svg") center / 100% 100% no-repeat !important;
    pointer-events: none;
    z-index: 8;
  }
  .home-page .about-strip::after {
    top: auto;
    bottom: 0;
    height: 32px;
    background: url("/assets/section-curve-exact.svg") center / 100% 100% no-repeat;
  }

  .gallery-page .gallery-strip {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    display: block !important;
    width: 100% !important;
    height: 430px !important;
    margin-top: 28px !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff;
  }
  .gallery-page .gallery-item,
  .gallery-page .gallery-item:hover {
    position: absolute !important;
    display: none;
    left: 16px !important;
    top: 0 !important;
    width: calc(100% - 32px) !important;
    height: 330px !important;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: none;
  }
  .gallery-page .gallery-item.g3 { display: block; }
  .gallery-page .gallery-strip::before,
  .gallery-page .gallery-strip::after { display: none !important; }
  .gallery-page .gallery-arrow {
    position: absolute !important;
    top: 348px !important;
    display: grid !important;
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .gallery-page .gallery-arrow.left { left: calc(50% - 66px) !important; }
  .gallery-page .gallery-arrow.right { left: calc(50% + 14px) !important; }
  .gallery-page .gallery-arrow img { position: static !important; display: block !important; width: 52px !important; height: 52px !important; border-radius: 50%; }
  .gallery-page .gallery-arrow.right img { transform: rotate(180deg); }

  .faq-page .faq-bubble-bg { display: none !important; }
  .faq-page .faq-list button,
  .faq-page .faq-list article:nth-child(n) button { background: #e2e2e2 !important; border-radius: 14px !important; }
  .faq-page .faq-list p,
  .faq-page .faq-list article:nth-child(n) p { background: #ffcc00 !important; border-radius: 14px !important; }
}
@media (max-width: 700px) { .faq-page .faq-list article.is-open button::after { content: "−" !important; } }
