/* /tools/ mobile — same visual language as the homepage tile decks.
   Desktop is untouched: every rule is inside max-width 767px. */

.th-m { display: none; }

@media screen and (max-width: 767px) {
  html[data-page="tools"] {
    --sn-canvas: #eef1f5;
    --sn-surface: #ffffff;
    --sn-ink: #0d1520;
    --sn-ink-2: #465868;
    --sn-ink-3: #8593a1;
    --sn-brand: #f59e0b;
    --sn-accent: #00a651;
    --sn-gap: 12px;
    --sn-pad: 16px;
    --sn-radius: 20px;
    --sn-radius-sm: 14px;
    --sn-elev-1: 0 1px 2px rgba(13, 21, 32, 0.04), 0 10px 24px -16px rgba(13, 21, 32, 0.18);
    --sn-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  html[data-page="tools"] body,
  html[data-page="tools"] .container_1,
  html[data-page="tools"] .tools-hub,
  html[data-page="tools"] .tools-hub-page,
  html[data-page="tools"] .ai-hub-page {
    background: var(--sn-canvas) !important;
  }

  /* Same chrome lock as homepage. Conflicting sources that created the gap:
     - header-mobile.css: container_1 padding-top 52px (header offset)
     - this file / critical CSS: .th-m padding-top another 52px
     - header-mobile .header { position:fixed } WITHOUT !important
     - cms-orchestrator.js + site-theme-css-lib.js @600px: logo width 100%
       stacks the header into two in-flow rows (~72+72)
     - cms-orchestrator .services { min-height:76px; margin-bottom:10px }
     Do not also pad .container_1 — that was the extra band. */
  html[data-page="tools"] body .container_1 {
    padding-top: 0 !important;
  }

  html[data-page="tools"] body .container_1 > .header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    z-index: 4000;
    overflow: hidden !important;
  }

  html[data-page="tools"] body .container_1 > .header .header-first-section {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    padding-top: 0 !important;
    overflow: hidden !important;
  }

  html[data-page="tools"] body .container_1 > .header .header-logo-section {
    min-height: 0 !important;
    max-height: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 34% !important;
  }

  html[data-page="tools"] body .container_1 > .services,
  html[data-page="tools"] body .container_1 > .menuBack,
  html[data-page="tools"] .container_1 > .services,
  html[data-page="tools"] .container_1 > .menuBack {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
  }

  html[data-page="tools"] .tools-hub,
  html[data-page="tools"] .tools-hub-page,
  html[data-page="tools"] .ai-hub-page,
  html[data-page="tools"] .ai-page {
    min-height: 0 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 28px !important;
  }

  html[data-page="tools"] .th-hero,
  html[data-page="tools"] .tools-hub-trust,
  html[data-page="tools"] .ai-section {
    display: none !important;
  }

  html[data-page="tools"] .th-m {
    display: block !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 60px 0 0 !important;
  }

  html[data-page="tools"] .th-m-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 var(--sn-gap);
    padding: 0 4px 8px;
  }

  html[data-page="tools"] .th-m-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.35;
    color: var(--sn-ink);
  }

  html[data-page="tools"] .th-m-title::before {
    content: "";
    width: 4px;
    height: 17px;
    border-radius: 999px;
    flex-shrink: 0;
    background: var(--sn-brand);
  }

  html[data-page="tools"] .th-m-home {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(0, 166, 81, 0.08);
    color: var(--sn-accent) !important;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none !important;
  }

  html[data-page="tools"] .th-m-home::after {
    content: "";
    width: 5px;
    height: 5px;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.85;
  }

  html[data-page="tools"] .th-m-hint { display: none !important; }

  html[data-page="tools"] .th-m-block {
    margin: 0 var(--sn-gap) 28px;
    padding: 12px 0 16px;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }

  html[data-page="tools"] .th-m-block::before { display: none; }

  html[data-page="tools"] .th-m-block__head { display: none !important; }

  html[data-page="tools"] .th-m-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 2px;
    padding: 0 6px 4px;
  }

  html[data-page="tools"] .th-m-tile {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 2px 1px !important;
    border: 0 !important;
    border-radius: var(--sn-radius-sm);
    background: none !important;
    box-shadow: none !important;
    color: var(--sn-ink-2) !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.16s var(--sn-ease);
  }

  html[data-page="tools"] .th-m-tile:active { transform: scale(0.93); }

  html[data-page="tools"] .th-m-tile:focus-visible {
    outline: 2px solid var(--sn-brand);
    outline-offset: 3px;
  }

  html[data-page="tools"] .th-m-tile__icon {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22),
                0 6px 14px -8px rgba(13, 21, 32, 0.35);
  }

  html[data-page="tools"] .th-m-tile__icon svg {
    width: 26px;
    height: 26px;
    display: block;
    stroke: #fff;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html[data-page="tools"] .th-m-tile__icon img {
    width: 30px;
    height: 30px;
    display: block;
    object-fit: contain;
  }

  html[data-page="tools"] .th-m-tile__icon--mask img {
    filter: brightness(0) invert(1);
  }

  html[data-page="tools"] .th-m-tile__icon--img {
    background: #f7f8fa !important;
    box-shadow: inset 0 0 0 1px rgba(13, 21, 32, 0.05),
                0 4px 12px -7px rgba(13, 21, 32, 0.2);
  }

  html[data-page="tools"] .th-m-tile__icon--img img {
    filter: none;
    width: 34px;
    height: 34px;
  }

  html[data-page="tools"] .th-m-tile__label {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: var(--sn-ink-2);
    letter-spacing: -0.1px;
    max-width: 100%;
    min-height: 3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  html[data-page="tools"] .th-m-tile__icon--c0 { background: linear-gradient(160deg, #2dd4bf, #0f9d96); }
  html[data-page="tools"] .th-m-tile__icon--c1 { background: linear-gradient(160deg, #818cf8, #4f46e5); }
  html[data-page="tools"] .th-m-tile__icon--c2 { background: linear-gradient(160deg, #fbbf24, #d97706); }
  html[data-page="tools"] .th-m-tile__icon--c3 { background: linear-gradient(160deg, #34d399, #059669); }
  html[data-page="tools"] .th-m-tile__icon--c4 { background: linear-gradient(160deg, #a78bfa, #6d28d9); }
  html[data-page="tools"] .th-m-tile__icon--c5 { background: linear-gradient(160deg, #fb7185, #e11d48); }
  html[data-page="tools"] .th-m-tile__icon--c6 { background: linear-gradient(160deg, #38bdf8, #0284c7); }
  html[data-page="tools"] .th-m-tile__icon--c7 { background: linear-gradient(160deg, #facc15, #ca8a04); }
}
