/* ToolRivo - shared mobile polish (loaded last on every page) */

/* ---------- Safety nets for every page ---------- */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
img,video,canvas,svg{max-width:100%}
img{height:auto}
pre,code{overflow-wrap:anywhere}
table{max-width:100%}

/* Nicer file picker button everywhere (was the default grey browser button) */
input[type=file]{max-width:100%;font-size:15px}
input[type=file]::file-selector-button{
  margin-right:12px;padding:10px 16px;border:0;border-radius:10px;
  background:#4f46e5;color:#fff;font:inherit;font-weight:700;cursor:pointer
}

/* ---------- Plain PDF tool pages (body.tr-plain) ---------- */
body.tr-plain{padding:16px 14px 40px;box-sizing:border-box;line-height:1.6}
body.tr-plain .wrap{
  width:100%;box-sizing:border-box;margin:16px auto;padding:24px 20px
}
body.tr-plain .wrap>a:first-child{display:inline-flex;align-items:center;min-height:44px;font-weight:600;text-decoration:none;color:#126e68}
body.tr-plain h1{font-size:clamp(26px,7vw,34px);line-height:1.2;margin:8px 0 10px}
body.tr-plain .wrap>p{color:#35505c}
body.tr-plain input[type=file]{
  display:block;width:100%;box-sizing:border-box;margin:16px 0;padding:18px 14px;
  border:2px dashed #9fc7c3;border-radius:14px;background:#f2faf9;color:#35505c;cursor:pointer
}
body.tr-plain input[type=file]::file-selector-button{background:#126e68}
body.tr-plain input:not([type=file]):not([type=range]):not([type=checkbox]):not([type=radio]),
body.tr-plain select{
  display:block;width:100%;box-sizing:border-box;min-height:48px;margin:12px 0;padding:10px 14px;
  border:1px solid #c9d8de;border-radius:12px;background:#fff;color:#102331;font-size:16px
}
body.tr-plain input[type=range]{display:block;width:100%;margin:18px 0}
body.tr-plain .btn{min-height:48px;padding:12px 22px;font-size:16px;margin:8px 0}
body.tr-plain .btn:disabled{opacity:.55;cursor:not-allowed}
body.tr-plain .status{line-height:1.5}
body.tr-plain .status:empty{display:none}
body.tr-plain .seo-content{max-width:760px;margin-inline:auto;padding:0 6px;box-sizing:border-box}
body.tr-plain .tr-blog{margin-inline:auto;box-sizing:border-box}
body.tr-plain .tr-related{display:flex;flex-wrap:wrap;gap:8px}
body.tr-plain .tr-related a{display:inline-flex;align-items:center;min-height:44px;padding:0 14px}

/* ---------- Phones ---------- */
@media (max-width:640px){
  /* 16px stops iPhone Safari from zooming the page when a field is tapped */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
  select,textarea{font-size:16px!important}

  /* bigger tap targets for footer / header links */
  footer a,.footer a,.footer-links a,.footer-nav a{
    display:inline-flex;align-items:center;min-height:44px;padding-inline:6px
  }
  header a,nav a,.back,.back-link,.crumbs a{min-height:44px;display:inline-flex;align-items:center}

  button,.btn,.cta,[role=button],input[type=submit]{min-height:44px}
  a.btn,a.cta{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}

  body.tr-plain{padding:10px 10px 32px}
  body.tr-plain .wrap{margin:8px auto;padding:20px 16px;border-radius:16px}
  body.tr-plain .btn{width:100%}
  body.tr-plain .seo-content h2{font-size:22px;line-height:1.3}
  body.tr-plain .seo-content p,body.tr-plain .seo-content li{font-size:16px}
}
@media (max-width:360px){
  body.tr-plain .wrap{padding:18px 14px}
  input[type=file]::file-selector-button{display:block;margin:0 0 8px}
}


/* ---------- App-like mobile shell (2026-11-19) ---------- */
@media(max-width:700px){
  html{scroll-padding-top:76px}
  body{font-size:15px;overflow-x:hidden}
  .wrap{max-width:100%;width:100%;padding-left:14px;padding-right:14px}
  .site-header{top:0;padding-top:6px}
  .nav{border-radius:17px;padding:10px 12px;gap:9px}
  .brand{font-size:19px}
  .logo{width:34px;height:34px;flex:0 0 34px}
  .hero{padding-top:28px;padding-bottom:22px;grid-template-columns:minmax(0,1fr);gap:18px}
  .hero h1{font-size:clamp(34px,9vw,48px);line-height:1.08}
  .hero p{font-size:15px;line-height:1.65}
  .hero-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .hero-actions .btn,.hero-actions a{width:100%;min-height:48px}
  .tool-grid,.tools-grid,.xgrid,.qr-card-grid,.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .tool-card,.qr-card,.glass{min-width:0;border-radius:16px}
  .tool-card h3,.qr-card h3{font-size:14px;line-height:1.35}
  .section{padding:38px 0}
  .section-head{margin-bottom:20px}
  .search,.search-box,.tool-search{width:100%;min-width:0}
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),select,textarea{font-size:16px}
  button,.btn,.cta,[role=button],input[type=submit]{min-height:44px}
  .footer,.site-footer{padding-bottom:calc(86px + env(safe-area-inset-bottom))}
  .footer-links,.footer-nav{gap:8px 12px}
  .footer a,.footer-links a,.footer-nav a{min-height:44px}
  body.tr-plain .wrap{padding:18px 14px}
}
@media(max-width:380px){
  .tool-grid,.tools-grid,.xgrid,.qr-card-grid,.category-grid{grid-template-columns:minmax(0,1fr)}
  .nav{gap:6px;padding:8px}
}
@media(display-mode:standalone){
  body{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  .site-header{top:env(safe-area-inset-top)}
}
