/**
 * ToolsLuv — Mobile Shell (M2A)
 * Canonical owner for shared mobile page chrome at max-width: 760px.
 * Scope: header, nav, breadcrumb, tool hero shell, page spacing.
 * Do NOT add workspace/upload/PDF/image tool rules here.
 */
@media (max-width: 760px) {
  html[data-tl-mobile-shell="v1"],
  html[data-tl-mobile-shell="v1"] body {
    margin: 0;
    overflow-x: hidden;
    background: #f8fbff;
    color: #181d20;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  }

  html[data-tl-mobile-shell="v1"] body {
    min-height: 100%;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
  }

  html[data-tl-mobile-shell="v1"] *,
  html[data-tl-mobile-shell="v1"] *::before,
  html[data-tl-mobile-shell="v1"] *::after {
    box-sizing: border-box;
  }

  html[data-tl-mobile-shell="v1"] a {
    color: inherit;
    text-decoration: none;
  }

  html[data-tl-mobile-shell="v1"] img {
    display: block;
    max-width: 100%;
    height: auto;
  }

  html[data-tl-mobile-shell="v1"] .skip-link,
  html[data-tl-mobile-shell="v1"] .cursor-glow,
  html[data-tl-mobile-shell="v1"] .reading-progress {
    display: none;
  }

  /* Header */
  html[data-tl-mobile-shell="v1"] .site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e6edf7;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  }

  html[data-tl-mobile-shell="v1"] .nav-wrap {
    min-height: 68px;
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  html[data-tl-mobile-shell="v1"] .brand {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  html[data-tl-mobile-shell="v1"] .brand-full-logo {
    width: auto;
    height: 58px;
    max-width: 220px;
    object-fit: contain;
  }

  html[data-tl-mobile-shell="v1"] .nav-toggle {
    display: flex;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: #4b5563;
    color: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
  }

  /* Legacy dark-mode nav toggle — required to beat global style.min.css */
  html[data-theme="dark"][data-tl-mobile-shell="v1"] .nav-toggle {
    background: linear-gradient(180deg, #1e3a4a, #0f2433) !important;
    border-color: rgba(125, 211, 252, 0.48) !important;
    color: #e0f2fe !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
  }

  html[data-tl-mobile-shell="v1"] .nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
  }

  html[data-tl-mobile-shell="v1"] .site-nav {
    display: none;
  }

  html[data-tl-mobile-shell="v1"].nav-open .site-nav,
  html[data-tl-mobile-shell="v1"] .site-nav.open {
    display: flex;
  }

  /* Page shell spacing */
  html[data-tl-mobile-shell="v1"] .page-shell,
  html[data-tl-mobile-shell="v1"] .tool-page,
  html[data-tl-mobile-shell="v1"] .ilove-home,
  html[data-tl-mobile-shell="v1"] .category-page,
  html[data-tl-mobile-shell="v1"] .article-page {
    width: 100%;
    max-width: 100%;
    padding: 0 1rem 2rem;
  }

  /* Breadcrumb */
  html[data-tl-mobile-shell="v1"] .breadcrumb {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.42rem;
    min-height: 48px;
    margin: 0 -1rem 1rem;
    padding: 0 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    color: #2563eb;
    font-weight: 700;
    font-size: clamp(0.78rem, 3.15vw, 0.95rem);
    background: rgba(255, 255, 255, 0.72);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  html[data-tl-mobile-shell="v1"] .breadcrumb::-webkit-scrollbar {
    display: none;
  }

  html[data-tl-mobile-shell="v1"] .breadcrumb a,
  html[data-tl-mobile-shell="v1"] .breadcrumb span {
    flex-shrink: 0;
    white-space: nowrap;
  }

  html[data-tl-mobile-shell="v1"] .breadcrumb a {
    font-weight: 800;
  }

  /* Generic tool hero */
  html[data-tl-mobile-shell="v1"] .tool-page-hero,
  html[data-tl-mobile-shell="v1"] .category-hero,
  html[data-tl-mobile-shell="v1"] .ilove-hero {
    margin: 1rem -1rem 1.1rem;
    padding: 2.1rem 1rem 2.4rem;
    text-align: center;
    background: linear-gradient(180deg, #f8fbff, #f1f8ff);
  }

  html[data-tl-mobile-shell="v1"] .tool-page-hero h1,
  html[data-tl-mobile-shell="v1"] .category-hero h1,
  html[data-tl-mobile-shell="v1"] .ilove-hero h1 {
    margin: 0.45rem auto 0;
    color: #181d20;
    font-size: clamp(2.55rem, 13vw, 4.3rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 900;
  }

  html[data-tl-mobile-shell="v1"] .tool-page-hero p,
  html[data-tl-mobile-shell="v1"] .category-hero p,
  html[data-tl-mobile-shell="v1"] .ilove-hero p {
    max-width: 680px;
    margin: 0.9rem auto 0;
    color: #536273;
    font-size: 1rem;
  }

  /* Category hero override — image tools compact hero */
  html[data-tl-mobile-shell="v1"] body.flux-tool-image-tools main:not([data-tool="passport-photo-maker"]):not([data-tool="device-mockup-generator"]) .tool-page-hero {
    margin: 0.5rem 0 0.65rem;
    padding: 1rem 0.85rem 0.55rem;
    background: transparent;
  }

  html[data-tl-mobile-shell="v1"] body.flux-tool-image-tools main:not([data-tool="passport-photo-maker"]):not([data-tool="device-mockup-generator"]) .tool-page-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2rem);
    margin-top: 0.2rem;
  }

  html[data-tl-mobile-shell="v1"] body.flux-tool-image-tools main:not([data-tool="passport-photo-maker"]):not([data-tool="device-mockup-generator"]) .tool-page-hero p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    margin-top: 0.45rem;
    font-size: 0.95rem;
  }

  html[data-tl-mobile-shell="v1"] .eyebrow {
    display: inline-flex;
    justify-content: center;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  html[data-tl-mobile-shell="v1"] .tool-layout,
  html[data-tl-mobile-shell="v1"] .tool-main {
    display: block;
    width: 100%;
    min-width: 0;
  }

  /* M5A PDF + migrated tools: defer header/nav chrome to mobile-v2 drawer-lock + nav-shared */
  html[data-tl-mobile-v2="tool-v1"] .site-header .nav-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    border-color: #e5e7eb;
    box-shadow: none;
  }

  html[data-tl-mobile-v2="tool-v1"] .site-header .nav-toggle span {
    width: 20px;
    height: 2px;
  }

  html[data-tl-mobile-v2="tool-v1"]:not(.nav-open) .site-header .site-nav#primaryNav:not(.open) {
    display: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}
