/* Public mobile layout only; tablet and desktop retain their existing rules. */
@media (max-width: 767px) {
  .kgc-public .breadcrumbs { text-align: center; }
  .kgc-public .breadcrumbs ol { justify-content: center; padding-inline: 0; }
  .kgc-public .row { --bs-gutter-x: 1.5rem; }
  .kgc-public #header > .container-fluid { gap: 12px; }
  .kgc-public #header .logo { gap: 8px; }
  .kgc-public #header .logo img { width: 56px; height: 56px; flex-shrink: 0; }
  .kgc-public #header .brand-title { white-space: normal; font-size: clamp(.72rem, 2.5vw, 1rem); }
  .kgc-public #header .brand-subtitle { font-size: .6rem; letter-spacing: 0; }
  /* Keep the navigation controls visible while icon fonts load. */
  .kgc-public #header .mobile-nav-show::before {
    content: ""; display: block; width: 20px; height: 2px; margin: auto;
    background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor;
  }
  .kgc-public #header .mobile-nav-hide::before,
  .kgc-public #header .mobile-nav-hide::after {
    content: ""; position: absolute; width: 20px; height: 2px; left: 11px; top: 20px;
    background: currentColor; transform: rotate(45deg);
  }
  .kgc-public #header .mobile-nav-hide::after { transform: rotate(-45deg); }
  .kgc-public #header .navbar { max-height: 100dvh; }
  .kgc-public #header .navbar ul { overscroll-behavior: contain; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
  .kgc-public :is(h1,h2,h3,h4,h5,h6,a,.badge,.hero-chip) { overflow-wrap: anywhere; }
  .kgc-public :is(p,li,dd,blockquote) { overflow-wrap: anywhere; }
  .kgc-public :is(.d-flex,.footer-brand) > * { min-width: 0; }
  .kgc-public :is(.btn,.btn-visit,.btn-secondary-soft) { max-width: 100%; min-height: 44px; white-space: normal; }
  .kgc-public :is(input,select,textarea,.form-control,.form-select) { max-width: 100%; font-size: 16px; }
  .kgc-public .kgc-product-filter > div { flex: 1 1 100%; }
  .kgc-public .kgc-product-filter > :is(button,a) { flex: 1 1 auto; }
  .kgc-public .gallery-toolbar > .d-flex { flex-wrap: wrap; }
  .kgc-public .gallery-toolbar > .d-flex > :is(button,a) { flex: 1 1 auto; }
  .kgc-public .blog-hero { padding: 32px 20px; border-radius: 20px; }
  .kgc-public .blog-hero .hero-actions > * { max-width: 100%; }
  .kgc-public :is(.contact-form-card,.contact-info-card) { padding: 24px !important; }
  .kgc-public .expertise-strip span { min-width: 0; overflow-wrap: anywhere; }
  .kgc-public .project-details-page .specs li { flex-wrap: wrap; gap: 8px; align-items: flex-start; }
  .kgc-public .project-details-page .specs span { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
  .kgc-public :is(.pd-body,.product-description,.service-details,.portfolio-description) img { max-width: 100% !important; height: auto; }
  .kgc-public :is(.pd-body,.product-description,.service-details,.portfolio-description) table { display: block; max-width: 100%; overflow-x: auto; }
  .kgc-public .pagination { flex-wrap: wrap; gap: 4px; }
  .kgc-public :is(.page-link,.filter-pill,.portfolio-flters li) { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .kgc-public .team-service-link { min-height: 44px; }
  .kgc-public .footer.footer-modern .footer-links ul li { padding-block: 0; }
  .kgc-public .footer.footer-modern .footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .kgc-public .footer.footer-modern .footer-links--center { text-align: center; }
  .kgc-public .footer.footer-modern .footer-links--center ul { align-items: center; }
  .kgc-public .footer.footer-modern .footer-info > p { text-align: center; }
  .kgc-public .footer.footer-modern .footer-info > .social-links { justify-content: center; gap: 8px; }
  .kgc-public .footer.footer-modern .footer-info > .social-links a { margin-inline: 0; }
  .kgc-public .footer-brand > div { min-width: 0; }
  .kgc-public iframe { max-width: 100%; }
  .kgc-public :is(video,canvas,svg) { max-width: 100%; }
  .kgc-public pre { max-width: 100%; overflow-x: auto; }

  /* Authentication and administration use separate layouts. */
  :is(.kgc-auth,.kgc-dashboard) :is(.form-control,.form-select) { min-height: 44px; font-size: 16px; max-width: 100%; }
  :is(.kgc-auth,.kgc-dashboard) .btn { min-height: 44px; max-width: 100%; white-space: normal; }
  :is(.kgc-auth,.kgc-dashboard) :is(h1,h2,h3,p,a,.form-label) { overflow-wrap: anywhere; }
  .kgc-auth .brand-logo { max-width: 100%; height: auto; }
  .kgc-auth :is(.link-muted,.form-check-label) { display: inline-flex; align-items: center; min-height: 44px; }
  .kgc-dashboard .dash-content { min-width: 0; width: 100%; }
  .kgc-dashboard [data-toggle="dash-sidebar"] { min-width: 44px; }
  .kgc-dashboard .row > * { min-width: 0; }
  .kgc-dashboard .dash-sidebar { max-width: calc(100vw - 44px); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .kgc-dashboard :is(.sidebar-link,.dropdown-item) { min-height: 44px; }
  .kgc-dashboard :is(.dash-main > .d-flex,.card-header > .d-flex) { flex-wrap: wrap; gap: 12px; }
}

/* Branded mobile navigation drawer. */
.kgc-public #header :is(.mobile-menu-heading, .mobile-menu-label, .mobile-menu-icon) { display: none; }
@media (max-width: 1279px) {
  .kgc-public #header .navbar { width: min(360px, calc(100vw - 24px)); background: transparent; }
  .kgc-public #header .navbar > ul {
    display: flex; flex-direction: column; gap: 6px; list-style: none;
    padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
    border-radius: 24px 0 0 24px; box-shadow: -16px 0 64px rgba(12, 47, 55, .16);
    background: linear-gradient(165deg, #f2f9f8 0, #fff 210px); scrollbar-width: thin;
  }
  .kgc-public #header .navbar > ul > li { list-style: none; flex-shrink: 0; }
  .kgc-public #header .navbar .mobile-menu-heading {
    display: flex; align-items: center; gap: 10px; min-height: 56px;
    margin: 0 48px 20px 0; padding: 0;
  }
  .kgc-public #header .mobile-menu-heading img { width: 44px; height: 44px; object-fit: contain; }
  .kgc-public #header .mobile-menu-heading strong { display: block; color: var(--ink); font-size: 16px; letter-spacing: -.4px; }
  .kgc-public #header .mobile-menu-heading span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
  .kgc-public #header .navbar .mobile-menu-label { display: block; padding: 0 14px 10px; color: #7b9397; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
  .kgc-public #header .navbar > ul > li > a {
    justify-content: flex-start; gap: 14px; min-height: 52px; margin: 0; padding: 12px 14px;
    border: 1px solid transparent; border-radius: 12px; color: #52696e;
    font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none;
    transition: background .2s, color .2s, border-color .2s;
  }
  .kgc-public #header .navbar .mobile-menu-icon { display: inline-flex; align-items: center; justify-content: center; width: 24px; margin: 0; font-size: 19px; line-height: 1; }
  .kgc-public #header .navbar > ul > li > a span { flex: 1; }
  .kgc-public #header .navbar > ul > li > a:is(:hover, .active) { color: #08798b; background: #e6f3f3; border-color: #d2e9e9; }
  .kgc-public #header .navbar > ul > li > a.active { box-shadow: inset 3px 0 #078697; }
  .kgc-public #header .navbar > ul > li:last-child { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e5eeee; }
  .kgc-public #header .navbar > ul > li:last-child > a { min-height: 52px; padding: 12px 14px; border-radius: 12px; background: #087f91; color: #fff; box-shadow: 0 6px 16px rgba(8, 127, 145, .16); }
  .kgc-public #header .navbar > ul > li:last-child > a:is(:hover, .active) { background: #066b7b; border-color: transparent; }
  .kgc-public #header .mobile-nav-hide { top: max(28px, env(safe-area-inset-top)); right: 20px; border-radius: 50%; background: #fff; border-color: #deebeb; box-shadow: 0 3px 12px rgba(12,47,55,.04); }
  .kgc-public.mobile-nav-active #header .navbar::before { background: rgba(12, 39, 45, .4); backdrop-filter: blur(4px); }
  .kgc-public #header :is(.navbar a, .mobile-nav-toggle):focus-visible { outline: 3px solid #39a4b4; outline-offset: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  .kgc-public #header .navbar, .kgc-public #header .navbar a { transition: none; }
}