/* TechHack Tools Suite v0.8.2 — mobile-first responsive hardening.
 * Loaded last so WordPress/theme defaults cannot re-introduce narrow layouts.
 */
#tht-tools-app,
#tht-tools-app *{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
#tht-tools-app{max-width:100vw!important;min-width:0!important;overflow-x:hidden!important;-webkit-text-size-adjust:100%;text-size-adjust:100%}
#tht-tools-app .tht-page-surface{width:100%;max-width:100%;min-width:0}
#tht-tools-app .tht-page-inner{width:min(100%,1320px);max-width:1320px;min-width:0}
#tht-tools-app .tht-content,
#tht-tools-app .tht-tool-workspace,
#tht-tools-app .tht-tool-card-ui,
#tht-tools-app .tht-content>.tht-card,
#tht-tools-app .tht-v3-experience,
#tht-tools-app .tht-xp-strip,
#tht-tools-app .tht-xp-hero{min-width:0;max-width:100%}
#tht-tools-app img,
#tht-tools-app svg,
#tht-tools-app canvas{max-width:100%}
#tht-tools-app .tht-tool-card,
#tht-tools-app .tht-featured-card,
#tht-tools-app .tht-overview-card,
#tht-tools-app .tht-seo-box,
#tht-tools-app .tht-step-card,
#tht-tools-app .tht-v3-stat,
#tht-tools-app .tht-v2-card,
#tht-tools-app .tht-age-metric,
#tht-tools-app .tht-age-insight{min-width:0}
#tht-tools-app input:not([type=checkbox]):not([type=radio]):not([type=file]),
#tht-tools-app textarea,
#tht-tools-app select{max-width:100%;font-size:16px!important}

@media (max-width: 767px){
  /* Break out of the theme's centered/narrow content column on phones. */
  #tht-tools-app .tht-page-surface{
    width:100vw!important;
    max-width:100vw!important;
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
    border-left:0!important;
    border-right:0!important;
    border-radius:0!important;
  }
  #tht-tools-app .tht-page-inner{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:14px 12px 52px!important;
  }

  #tht-tools-app .tht-breadcrumb{margin:0 1px 14px!important;font-size:10px!important;line-height:1.4!important;overflow-x:auto;white-space:nowrap;padding-bottom:2px;scrollbar-width:none}
  #tht-tools-app .tht-breadcrumb::-webkit-scrollbar{display:none}

  /* Tool hero: use the complete screen width without oversized inner gutters. */
  #tht-tools-app .tht-tool-hero,
  #tht-tools-app .tht-xp-hero{grid-template-columns:1fr!important;gap:14px!important;padding:18px 16px!important;margin-bottom:14px!important;border-radius:18px!important;text-align:left!important}
  #tht-tools-app .tht-tool-hero-icon{width:58px!important;height:58px!important;border-radius:17px!important}
  #tht-tools-app .tht-tool-hero-icon svg{width:28px!important;height:28px!important}
  #tht-tools-app .tht-tool-hero h1{font-size:clamp(26px,8.5vw,36px)!important;line-height:1.08!important;overflow-wrap:anywhere}
  #tht-tools-app .tht-tool-hero-copy>p{font-size:12px!important;line-height:1.65!important}
  #tht-tools-app .tht-tool-badges{gap:6px;margin-top:12px}
  #tht-tools-app .tht-tool-badges span{padding:6px 8px;font-size:9px}
  #tht-tools-app .tht-tool-quickfacts{display:grid!important;grid-template-columns:1fr;gap:6px;margin-top:11px;font-size:9.5px}
  #tht-tools-app .tht-xp-promise{margin-top:10px!important}

  /* Workspace should feel edge-to-edge on phones. */
  #tht-tools-app .tht-tool-workspace{margin-bottom:16px!important;padding:0!important;border-radius:18px!important;background:#eef4f8!important;border:1px solid #d6e2eb!important;box-shadow:0 9px 24px rgba(20,51,78,.05)!important}
  #tht-tools-app .tht-tool-workspace-label{padding:10px 12px!important;font-size:9px!important;gap:7px!important}
  #tht-tools-app .tht-tool-workspace-label em{margin-left:auto;max-width:48%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #tht-tools-app .tht-content{padding:0!important}
  #tht-tools-app .tht-tool-card-ui,
  #tht-tools-app .tht-content>.tht-card{padding:16px!important;border-radius:16px!important}

  /* Generic form grids collapse to one comfortable column. */
  #tht-tools-app .tht-tool-options,
  #tht-tools-app .tht-form-grid,
  #tht-tools-app .tht-form-grid-3,
  #tht-tools-app .tht-form-grid-4{grid-template-columns:1fr!important;gap:10px!important}
  #tht-tools-app .tht-tool-ui-head{gap:10px!important;margin-bottom:14px!important}
  #tht-tools-app .tht-tool-ui-head h2{font-size:19px!important}
  #tht-tools-app .tht-tool-ui-head p{font-size:10px!important}
  #tht-tools-app .tht-live-pill{align-self:flex-start}
  #tht-tools-app .tht-tool-actions{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
  #tht-tools-app .tht-tool-actions .tht-btn,
  #tht-tools-app .tht-actions .tht-btn{width:100%!important}
  #tht-tools-app .tht-action-note{width:100%!important;text-align:left!important}

  /* File/image tools */
  #tht-tools-app .tht-file-drop{min-height:170px!important;padding:24px 12px!important;border-radius:15px!important}
  #tht-tools-app .tht-file-drop>p{max-width:280px}
  #tht-tools-app .tht-file-list{max-width:none!important}
  #tht-tools-app .tht-file-item{min-width:0}
  #tht-tools-app .tht-file-item strong{max-width:100%;overflow:hidden;text-overflow:ellipsis}
  #tht-tools-app .tht-file-preview{grid-template-columns:1fr!important}

  /* Result cards */
  #tht-tools-app .tht-result-ready,
  #tht-tools-app .tht-result-error,
  #tht-tools-app .tht-result-loading,
  #tht-tools-app .tht-result-success{padding:16px!important;border-radius:15px!important}
  #tht-tools-app .tht-result-metrics,
  #tht-tools-app .tht-result-metrics-3{grid-template-columns:1fr 1fr!important;gap:8px!important}
  #tht-tools-app .tht-result-metrics>div{padding:11px!important}
  #tht-tools-app .tht-result-metrics strong{font-size:15px!important}
  #tht-tools-app .tht-result-download{width:100%!important}
  #tht-tools-app .tht-result-lead,
  #tht-tools-app .tht-age-main{align-items:flex-start!important;gap:10px!important}

  /* Batch 1 flagship experiences */
  #tht-tools-app .tht-b1-stage,
  #tht-tools-app .tht-v2-result,
  #tht-tools-app .tht-creative-result{gap:12px!important}
  #tht-tools-app .tht-b1-stage{padding:14px!important;border-radius:16px!important}
  #tht-tools-app .tht-b1-cards,
  #tht-tools-app .tht-age-metrics,
  #tht-tools-app .tht-age-insights,
  #tht-tools-app .tht-creative-stats,
  #tht-tools-app .tht-v3-stats{grid-template-columns:1fr 1fr!important;gap:8px!important}
  #tht-tools-app .tht-age-metric{padding:11px!important;border-radius:14px!important}
  #tht-tools-app .tht-age-metric strong{font-size:20px!important}
  #tht-tools-app .tht-age-metric-icon{width:32px!important;height:32px!important;margin-bottom:8px!important}
  #tht-tools-app .tht-age-hero{grid-template-columns:1fr!important;gap:12px!important;padding:16px!important;border-radius:17px!important}
  #tht-tools-app .tht-age-orb{width:122px!important;height:122px!important;margin:0 auto!important}
  #tht-tools-app .tht-age-orb strong{font-size:40px!important}
  #tht-tools-app .tht-age-hero-copy{text-align:center}
  #tht-tools-app .tht-age-hero-copy h3{font-size:22px!important}
  #tht-tools-app .tht-age-timeline{grid-template-columns:1fr 1fr!important;gap:12px!important}
  #tht-tools-app .tht-creative-hero-row,
  #tht-tools-app .tht-v2-result-hero,
  #tht-tools-app .tht-b1-hero,
  #tht-tools-app .tht-b1-money-hero,
  #tht-tools-app .tht-b1-grid,
  #tht-tools-app .tht-b1-password,
  #tht-tools-app .tht-v3-body{grid-template-columns:1fr!important}
  #tht-tools-app .tht-percent-ring,
  #tht-tools-app .tht-v2-orb,
  #tht-tools-app .tht-emi-orb,
  #tht-tools-app .tht-number-orb,
  #tht-tools-app .tht-strength-orb{margin:0 auto!important}
  #tht-tools-app .tht-b1-actions{justify-content:stretch!important}
  #tht-tools-app .tht-b1-actions .tht-btn{width:100%!important}
  #tht-tools-app .tht-b1-inspector-grid{grid-template-columns:1fr 1fr!important}

  /* Batch 3 visual system */
  #tht-tools-app .tht-v3-experience{padding:14px!important;border-radius:18px!important;margin-top:12px!important}
  #tht-tools-app .tht-v3-deck-head{gap:10px!important;margin-bottom:12px!important}
  #tht-tools-app .tht-v3-title-wrap{gap:10px!important}
  #tht-tools-app .tht-v3-icon{width:44px!important;height:44px!important;border-radius:13px!important}
  #tht-tools-app .tht-v3-icon svg{width:20px!important;height:20px!important}
  #tht-tools-app .tht-v3-title-wrap h3{font-size:19px!important}
  #tht-tools-app .tht-v3-title-wrap p{font-size:11px!important}
  #tht-tools-app .tht-v3-status{align-self:flex-start!important;font-size:9px!important}
  #tht-tools-app .tht-v3-stats{grid-template-columns:1fr 1fr!important}
  #tht-tools-app .tht-v3-stat{min-height:82px;padding:11px!important;border-radius:14px!important}
  #tht-tools-app .tht-v3-stat-icon{width:30px!important;height:30px!important}
  #tht-tools-app .tht-v3-stat strong{font-size:15px!important}
  #tht-tools-app .tht-v3-body{grid-template-columns:1fr!important}
  #tht-tools-app .tht-v3-actions{display:grid!important;grid-template-columns:1fr 1fr!important}
  #tht-tools-app .tht-v3-action{width:100%!important;justify-content:center!important}

  /* Long code/hash/file outputs must scroll inside their own box. */
  #tht-tools-app .tht-code-output,
  #tht-tools-app pre,
  #tht-tools-app code{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
  #tht-tools-app .tht-code-output{overflow:auto;-webkit-overflow-scrolling:touch;font-size:11px!important}
  #tht-tools-app .tht-file-info-result{grid-template-columns:1fr!important}
  #tht-tools-app .tht-social-grid,
  #tht-tools-app .tht-palette-grid{grid-template-columns:1fr 1fr!important}
  #tht-tools-app .tht-gradient-preview{height:150px!important}

  /* SEO/content sections: reduce vertical waste while keeping readable touch targets. */
  #tht-tools-app .tht-tool-overview,
  #tht-tools-app .tht-seo-section,
  #tht-tools-app .tht-faq-section{margin:32px 0!important}
  #tht-tools-app .tht-section-heading{margin-bottom:13px!important}
  #tht-tools-app .tht-section-heading h2,
  #tht-tools-app .tht-how-it-works h2,
  #tht-tools-app .tht-info-panel h2,
  #tht-tools-app .tht-seo-section h2,
  #tht-tools-app .tht-faq-section h2{font-size:24px!important}
  #tht-tools-app .tht-overview-list,
  #tht-tools-app .tht-stat-grid,
  #tht-tools-app .tht-code-grid{grid-template-columns:1fr 1fr!important;gap:8px!important}
  #tht-tools-app .tht-benefit-row{grid-template-columns:1fr 1fr!important;gap:8px!important}
  #tht-tools-app .tht-benefit-chip{padding:10px!important}
  #tht-tools-app .tht-step-list,
  #tht-tools-app .tht-seo-grid{grid-template-columns:1fr!important;gap:10px!important}
  #tht-tools-app .tht-how-it-works{grid-template-columns:1fr!important;gap:18px!important;margin:40px 0 16px!important;padding:18px!important;border-radius:18px!important}
  #tht-tools-app .tht-privacy-strip{align-items:flex-start!important;padding:14px!important;margin-top:14px!important}
  #tht-tools-app .tht-tool-cta{padding:16px!important;border-radius:18px!important}
}

@media (max-width: 430px){
  #tht-tools-app .tht-page-inner{padding-left:10px!important;padding-right:10px!important}
  #tht-tools-app .tht-tool-hero,
  #tht-tools-app .tht-xp-hero{padding:16px 13px!important}
  #tht-tools-app .tht-tool-hero h1{font-size:28px!important}
  #tht-tools-app .tht-tool-card-ui,
  #tht-tools-app .tht-content>.tht-card{padding:13px!important}
  #tht-tools-app .tht-b1-cards,
  #tht-tools-app .tht-age-metrics,
  #tht-tools-app .tht-age-insights,
  #tht-tools-app .tht-v3-stats{grid-template-columns:1fr!important}
  #tht-tools-app .tht-age-hero-copy h3{font-size:20px!important}
  #tht-tools-app .tht-b1-inspector-grid,
  #tht-tools-app .tht-social-grid,
  #tht-tools-app .tht-palette-grid,
  #tht-tools-app .tht-overview-list,
  #tht-tools-app .tht-stat-grid,
  #tht-tools-app .tht-code-grid{grid-template-columns:1fr!important}
  #tht-tools-app .tht-benefit-row{grid-template-columns:1fr!important}
  #tht-tools-app .tht-v3-actions{grid-template-columns:1fr!important}
  #tht-tools-app .tht-age-metric strong{font-size:22px!important}
}

@media (prefers-reduced-motion: reduce){
  #tht-tools-app *,#tht-tools-app *::before,#tht-tools-app *::after{scroll-behavior:auto!important}
}

/* v0.8.3 — theme-container escape + readable mobile gutters.
 * Some themes wrap template_redirect output inside padded/narrow content
 * containers. On Tools pages only, make those ancestors full-width so the
 * plugin can use the entire mobile viewport without touching header/footer.
 */
body.tht-tools-page .site-content:has(#tht-tools-app),
body.tht-tools-page .content-area:has(#tht-tools-app),
body.tht-tools-page .site-main:has(#tht-tools-app),
body.tht-tools-page .content-container:has(#tht-tools-app),
body.tht-tools-page .container:has(#tht-tools-app),
body.tht-tools-page .ast-container:has(#tht-tools-app),
body.tht-tools-page .inside-article:has(#tht-tools-app),
body.tht-tools-page .entry-content:has(#tht-tools-app),
body.tht-tools-page .wp-site-blocks:has(#tht-tools-app){
  width:100%!important;
  max-width:none!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:0!important;
  padding-right:0!important;
}

body.tht-tools-page .site-content:has(#tht-tools-app),
body.tht-tools-page .content-area:has(#tht-tools-app){
  overflow:visible!important;
}

@media (max-width: 767px){
  body.tht-tools-page #tht-tools-app,
  body.tht-tools-page #tht-tools-app .tht-page-surface{
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    position:relative!important;
    left:auto!important;
    right:auto!important;
    transform:none!important;
    overflow-x:clip!important;
  }

  body.tht-tools-page #tht-tools-app .tht-page-inner{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:16px 16px 54px!important;
  }

  body.tht-tools-page #tht-tools-app .tht-breadcrumb{
    margin:0 0 14px!important;
    padding:0!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-hero,
  body.tht-tools-page #tht-tools-app .tht-xp-hero{
    width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding:20px!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-hero-copy,
  body.tht-tools-page #tht-tools-app .tht-tool-ui,
  body.tht-tools-page #tht-tools-app .tht-tool-card-ui,
  body.tht-tools-page #tht-tools-app .tht-content>.tht-card{
    min-width:0!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-hero h1,
  body.tht-tools-page #tht-tools-app .tht-tool-hero-copy>p,
  body.tht-tools-page #tht-tools-app .tht-tool-badges,
  body.tht-tools-page #tht-tools-app .tht-xp-promise,
  body.tht-tools-page #tht-tools-app .tht-tool-quickfacts{
    max-width:100%!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-workspace{
    width:100%!important;
    padding:0!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-workspace-label{
    padding:11px 14px!important;
  }

  body.tht-tools-page #tht-tools-app .tht-content{
    width:100%!important;
    padding:0!important;
  }

  body.tht-tools-page #tht-tools-app .tht-tool-card-ui,
  body.tht-tools-page #tht-tools-app .tht-content>.tht-card{
    width:100%!important;
    padding:18px!important;
    margin:0!important;
  }

  body.tht-tools-page #tht-tools-app .tht-field,
  body.tht-tools-page #tht-tools-app .tht-field-group,
  body.tht-tools-page #tht-tools-app .tht-form-group,
  body.tht-tools-page #tht-tools-app .tht-input-wrap{
    width:100%!important;
    min-width:0!important;
  }

  body.tht-tools-page #tht-tools-app input,
  body.tht-tools-page #tht-tools-app textarea,
  body.tht-tools-page #tht-tools-app select,
  body.tht-tools-page #tht-tools-app button,
  body.tht-tools-page #tht-tools-app .tht-btn{
    max-width:100%!important;
  }
}

@media (max-width: 380px){
  body.tht-tools-page #tht-tools-app .tht-page-inner{
    padding-left:13px!important;
    padding-right:13px!important;
  }
  body.tht-tools-page #tht-tools-app .tht-tool-hero,
  body.tht-tools-page #tht-tools-app .tht-xp-hero{
    padding:17px!important;
    border-radius:16px!important;
  }
  body.tht-tools-page #tht-tools-app .tht-tool-card-ui,
  body.tht-tools-page #tht-tools-app .tht-content>.tht-card{
    padding:15px!important;
    border-radius:15px!important;
  }
  body.tht-tools-page #tht-tools-app .tht-tool-hero h1{font-size:clamp(25px,8vw,31px)!important;}
}

/* v0.8.4 — component-width responsive system.
 * Some WordPress themes can leave the Tools page in a narrow content container,
 * while the browser viewport still reports a desktop layout width. Container
 * queries make the tool cards respond to the actual space they receive, not
 * just the global viewport width. This prevents four-card rows from becoming
 * unusably narrow on phones and embedded/mobile layouts.
 */
#tht-tools-app .tht-page-inner,
#tht-tools-app .tht-tool-workspace,
#tht-tools-app .tht-b1-stage,
#tht-tools-app .tht-v3-experience{
  container-type:inline-size;
}

#tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card strong,
#tht-tools-app .tht-b1-card strong,
#tht-tools-app .tht-age-metric strong,
#tht-tools-app .tht-v3-stat strong{
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
  font-variant-numeric:tabular-nums;
}

@container (max-width: 760px){
  #tht-tools-app .tht-b1-age .tht-b1-time-grid,
  #tht-tools-app .tht-b1-cards,
  #tht-tools-app .tht-age-metrics,
  #tht-tools-app .tht-creative-stats,
  #tht-tools-app .tht-v3-stats,
  #tht-tools-app .tht-result-metrics,
  #tht-tools-app .tht-result-metrics-3{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card,
  #tht-tools-app .tht-b1-cards .tht-b1-card,
  #tht-tools-app .tht-age-metric,
  #tht-tools-app .tht-v3-stat{
    min-width:0!important;
    width:100%!important;
    padding:14px!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card strong{
    font-size:clamp(16px,3.9cqw,20px)!important;
    line-height:1.15!important;
    white-space:normal!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card span{
    font-size:9px!important;
    line-height:1.35!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card .ico,
  #tht-tools-app .tht-age-metric-icon,
  #tht-tools-app .tht-v3-stat-icon{
    flex:0 0 auto;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card small{
    font-size:8px!important;
    line-height:1.3!important;
  }

  #tht-tools-app .tht-b1-inspector-grid,
  #tht-tools-app .tht-overview-list,
  #tht-tools-app .tht-stat-grid,
  #tht-tools-app .tht-code-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
}

@container (max-width: 420px){
  #tht-tools-app .tht-b1-stage{padding:12px!important}
  #tht-tools-app .tht-b1-age .tht-b1-time-grid,
  #tht-tools-app .tht-b1-cards,
  #tht-tools-app .tht-age-metrics,
  #tht-tools-app .tht-creative-stats,
  #tht-tools-app .tht-v3-stats,
  #tht-tools-app .tht-result-metrics,
  #tht-tools-app .tht-result-metrics-3{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card,
  #tht-tools-app .tht-b1-cards .tht-b1-card,
  #tht-tools-app .tht-age-metric,
  #tht-tools-app .tht-v3-stat{
    padding:11px!important;
    border-radius:13px!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card strong{
    font-size:17px!important;
    line-height:1.15!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card span{
    font-size:8px!important;
  }

  #tht-tools-app .tht-b1-age .tht-b1-time-grid .tht-b1-card .ico{
    width:30px!important;
    height:30px!important;
    margin-bottom:8px!important;
  }
}

@media (max-width: 767px){
  /* Explicitly fix the age grid as an additional fallback for normal mobile viewport media queries. */
  #tht-tools-app .tht-b1-age .tht-b1-time-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
}

/* Quality release: scoped narrow-screen accessibility and overflow guards. */
#tht-tools-app :is(input,textarea,select,button,a):focus-visible{outline:3px solid #2563eb;outline-offset:3px}
#tht-tools-app [hidden]{display:none!important}
#tht-tools-app :is(img,video,canvas,svg){max-width:100%}
#tht-tools-app :is(pre,code,.tht-result,.tht-tool-result){max-width:100%;overflow-wrap:anywhere}
#tht-tools-app pre{overflow:auto}
@media(max-width:600px){
 #tht-tools-app :is(input,select,textarea){font-size:16px!important;min-width:0;max-width:100%}
 #tht-tools-app :is(.tht-btn,button.tht-search-clear,.tht-category-chips button){min-height:44px;white-space:normal}
 #tht-tools-app :is(.tht-tool-card,.tht-featured-card,.tht-card-copy,.tht-featured-copy){min-width:0;overflow-wrap:anywhere}
 #tht-tools-app .tht-category-chips{max-width:100%;overflow-x:auto}
}
@media(prefers-reduced-motion:reduce){
 #tht-tools-app *,#tht-tools-app *::before,#tht-tools-app *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
