
/* =========================================================
   OneToolBox — Flip Image
   Premium readable layout
   ========================================================= */

*{box-sizing:border-box}

.tool-hero{
  padding:34px 0 24px !important;
  text-align:center;
}

.tool-hero h1{
  margin:0 0 12px !important;
  font-size:clamp(34px,4vw,48px) !important;
  line-height:1.15 !important;
  font-weight:900 !important;
  letter-spacing:-.5px;
}

.tool-hero p{
  max-width:820px;
  margin:0 auto !important;
  font-size:17px !important;
  line-height:1.65 !important;
}

.section{
  padding:28px 0 !important;
}

.flip-box{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
  align-items:start;
}

.flip-card,
.content-card{
  background:var(--bg-card,#fff);
  border:1px solid var(--border,#e2e8f0);
  border-radius:18px;
  box-shadow:0 8px 28px rgba(15,23,42,.07);
}

.flip-card{
  padding:22px;
}

.flip-card h3{
  margin:0 0 18px;
  font-size:20px;
  line-height:1.3;
  font-weight:850;
}

.upload-area{
  min-height:310px;
  padding:22px;
  border:2px dashed #cbd5e1;
  border-radius:15px;
  background:#f8fbff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  overflow:hidden;
  transition:.2s ease;
}

.upload-area:hover,
.upload-area.dragover{
  border-color:#2563eb;
  background:#eff6ff;
}

.upload-area>i{
  color:#2563eb;
  font-size:48px;
  margin-bottom:14px;
}

.original-preview{
  display:none;
  width:100%;
  max-height:255px;
  object-fit:contain;
  border-radius:10px;
  margin-bottom:14px;
  transition:transform .25s ease;
}

.upload-area h4{
  margin:0 0 10px;
  font-size:19px;
  line-height:1.35;
}

.upload-area p{
  margin:0 0 17px;
  font-size:14px;
  line-height:1.9;
  color:#64748b;
}

.choose-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:190px;
  min-height:46px;
  padding:11px 18px;
  border-radius:10px;
  background:#2563eb;
  color:#fff;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}

.choose-btn input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}

.btn-reset,
.btn-secondary,
.btn-primary,
.btn-success{
  min-height:45px;
  border-radius:10px;
  font-size:14px;
  font-weight:800;
}

.btn-reset,
.btn-secondary{
  width:100%;
  margin-top:9px;
  border:1px solid #dbe3ec;
  background:#f8fafc;
  color:#475569;
  cursor:pointer;
}

.btn-primary,
.btn-success{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  margin-top:10px;
  border:0;
  background:#2563eb;
  color:#fff;
  text-decoration:none;
  cursor:pointer;
}

.btn-success{background:#16a34a}
.btn-success.disabled{pointer-events:none;opacity:.45}

.info{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:43px;
  margin-top:9px;
  padding:9px 12px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
}

.info span,
.info b{
  font-size:13px;
  line-height:1.4;
}

.info span{color:#64748b}
.info b{color:#0f172a;text-align:right}

.setting-group{margin-bottom:17px}

.setting-group>label,
.setting-heading label{
  display:block;
  margin-bottom:8px;
  font-size:14px;
  font-weight:800;
  color:#334155;
}

.flip-control,
.quick-flip-btn{
  width:100%;
  min-height:46px;
  padding:9px 12px;
  border:1px solid #dbe3ec;
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}

.quick-flip-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.flip-status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:12px 0 17px;
  padding:12px 13px;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:#eff6ff;
}

.flip-status span,
.flip-status strong{
  font-size:13px;
}

.flip-status span{color:#64748b}
.flip-status strong{color:#2563eb}

.flip-card select{
  width:100%;
  height:46px;
  padding:0 12px;
  border:1px solid #cbd5e1;
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:14px;
  outline:none;
}

.setting-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.setting-heading strong{
  color:#2563eb;
  font-size:14px;
}

#qualityRange{
  display:block;
  width:100%;
  margin-top:5px;
  accent-color:#2563eb;
}

.image-preview{
  min-height:310px;
  padding:12px;
  border:1px solid #dbe3ec;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  background:
    linear-gradient(45deg,#f1f5f9 25%,transparent 25%),
    linear-gradient(-45deg,#f1f5f9 25%,transparent 25%),
    linear-gradient(45deg,transparent 75%,#f1f5f9 75%),
    linear-gradient(-45deg,transparent 75%,#f1f5f9 75%);
  background-size:20px 20px;
  background-position:0 0,0 10px,10px -10px,-10px 0;
}

.image-preview img{
  display:none;
  max-width:100%;
  max-height:285px;
  object-fit:contain;
  border-radius:9px;
}

.image-preview span{
  color:#64748b;
  font-size:14px;
  text-align:center;
}

/* ---------- LOWER CONTENT ---------- */

.content-card{
  padding:28px;
}

.content-card h2{
  margin:0 0 24px;
  text-align:center;
  font-size:30px;
  line-height:1.25;
  font-weight:900;
  letter-spacing:-.2px;
}

.feature-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
}

.feature-item{
  padding:20px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f8fafc;
  text-align:center;
}

.feature-item i{
  width:46px;
  height:46px;
  margin:0 auto 12px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#eff6ff;
  color:#2563eb;
  font-size:19px;
}

.feature-item h3{
  margin:0 0 8px;
  font-size:18px;
  line-height:1.35;
}

.feature-item p{
  margin:0;
  font-size:15px;
  line-height:1.65;
  color:#64748b;
}

.steps-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}

.step{
  padding:20px;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#f8fafc;
}

.step>span{
  width:34px;
  height:34px;
  margin-bottom:12px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#2563eb;
  color:#fff;
  font-size:14px;
  font-weight:900;
}

.step h3{
  margin:0 0 8px;
  font-size:18px;
  line-height:1.35;
}

.step p{
  margin:0;
  font-size:15px;
  line-height:1.65;
  color:#64748b;
}

/* ---------- FAQ ---------- */

.faq-card{
  max-width:1000px;
  margin-inline:auto;
}

.faq-card details{
  border-bottom:1px solid #e2e8f0;
}

.faq-card details:last-child{
  border-bottom:0;
}

.faq-card summary{
  position:relative;
  padding:18px 38px 18px 4px;
  color:#0f172a;
  font-size:17px;
  line-height:1.5;
  font-weight:850;
  cursor:pointer;
  list-style:none;
}

.faq-card summary::-webkit-details-marker{
  display:none;
}

.faq-card summary::after{
  content:"+";
  position:absolute;
  right:5px;
  top:15px;
  color:#2563eb;
  font-size:25px;
  font-weight:500;
}

.faq-card details[open] summary::after{
  content:"−";
}

.faq-card details p{
  margin:0;
  padding:0 38px 19px 4px;
  color:#475569;
  font-size:15px;
  line-height:1.75;
}

/* ---------- DARK MODE ---------- */

html.otb-dark .flip-card,
html.otb-dark .content-card,
body.dark .flip-card,
body.dark .content-card{
  background:#111827;
  border-color:#334155;
}

html.otb-dark .upload-area,
body.dark .upload-area{
  background:#0f172a;
  border-color:#475569;
}

html.otb-dark .info,
html.otb-dark .feature-item,
html.otb-dark .step,
body.dark .info,
body.dark .feature-item,
body.dark .step{
  background:#0f172a;
  border-color:#334155;
}

html.otb-dark .flip-card h3,
html.otb-dark .content-card h2,
html.otb-dark .upload-area h4,
html.otb-dark .info b,
html.otb-dark .feature-item h3,
html.otb-dark .step h3,
html.otb-dark .faq-card summary,
body.dark .flip-card h3,
body.dark .content-card h2,
body.dark .upload-area h4,
body.dark .info b,
body.dark .feature-item h3,
body.dark .step h3,
body.dark .faq-card summary{
  color:#f8fafc;
}

html.otb-dark .info span,
html.otb-dark .upload-area p,
html.otb-dark .feature-item p,
html.otb-dark .step p,
html.otb-dark .faq-card details p,
body.dark .info span,
body.dark .upload-area p,
body.dark .feature-item p,
body.dark .step p,
body.dark .faq-card details p{
  color:#94a3b8;
}

html.otb-dark .flip-control,
html.otb-dark .quick-flip-btn,
html.otb-dark .flip-card select,
body.dark .flip-control,
body.dark .quick-flip-btn,
body.dark .flip-card select{
  background:#0f172a;
  color:#e2e8f0;
  border-color:#334155;
}

/* ---------- RESPONSIVE ---------- */

@media(max-width:1100px){
  .flip-box{grid-template-columns:1fr 1fr}
  .flip-box .flip-card:last-child{grid-column:1/-1}
  .feature-grid{grid-template-columns:repeat(2,1fr)}
  .steps-grid{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:768px){
  .tool-hero{
    padding:28px 0 18px !important;
  }

  .tool-hero h1{
    font-size:34px !important;
  }

  .tool-hero p{
    font-size:15px !important;
  }

  .section{
    padding:20px 0 !important;
  }

  .flip-box,
  .feature-grid,
  .steps-grid{
    grid-template-columns:1fr;
  }

  .flip-box .flip-card:last-child{
    grid-column:auto;
  }

  .content-card{
    padding:21px;
  }

  .content-card h2{
    font-size:26px;
  }

  .feature-item p,
  .step p,
  .faq-card details p{
    font-size:15px;
  }
}

@media(max-width:480px){
  .tool-hero h1{
    font-size:30px !important;
  }

  .tool-hero p{
    font-size:14px !important;
  }

  .flip-card{
    padding:17px;
  }

  .quick-flip-grid{
    grid-template-columns:1fr;
  }

  .content-card h2{
    font-size:24px;
  }

  .faq-card summary{
    font-size:16px;
  }
}


/* =========================================================
   OneToolBox — Mobile Premium Polish
   ========================================================= */

@media (max-width: 768px){

  body{
    overflow-x:hidden;
  }

  .page-offset{
    padding-top:64px !important;
  }

  .tool-hero{
    padding:22px 12px 16px !important;
    margin:0 !important;
  }

  .tool-hero h1{
    font-size:32px !important;
    line-height:1.15 !important;
    margin-bottom:9px !important;
  }

  .tool-hero p{
    font-size:15px !important;
    line-height:1.55 !important;
    max-width:100% !important;
  }

  .section{
    padding:12px 0 22px !important;
  }

  .container{
    padding-left:12px !important;
    padding-right:12px !important;
  }

  .flip-box{
    display:flex !important;
    flex-direction:column !important;
    gap:15px !important;
    width:100%;
  }

  .flip-card,
  .content-card{
    width:100% !important;
    border:1.5px solid #cbd5e1 !important;
    border-radius:18px !important;
    box-shadow:0 7px 22px rgba(15,23,42,.08) !important;
    overflow:hidden;
  }

  .flip-card{
    padding:17px !important;
    background:linear-gradient(145deg,#ffffff,#f8fbff) !important;
  }

  .flip-card:nth-child(1){
    border-color:#bfdbfe !important;
    background:linear-gradient(145deg,#ffffff,#eff6ff) !important;
  }

  .flip-card:nth-child(2){
    border-color:#c7d2fe !important;
    background:linear-gradient(145deg,#ffffff,#eef2ff) !important;
  }

  .flip-card:nth-child(3){
    border-color:#bae6fd !important;
    background:linear-gradient(145deg,#ffffff,#f0f9ff) !important;
  }

  .flip-card h3{
    font-size:20px !important;
    margin-bottom:14px !important;
  }

  .upload-area{
    min-height:260px !important;
    padding:17px 12px !important;
    border-width:2px !important;
    border-color:#93c5fd !important;
    border-radius:15px !important;
    background:rgba(239,246,255,.72) !important;
  }

  .upload-area>i{
    font-size:42px !important;
  }

  .upload-area h4{
    font-size:18px !important;
  }

  .upload-area p{
    font-size:13px !important;
    line-height:1.7 !important;
  }

  .choose-btn{
    width:min(100%,220px) !important;
    min-height:48px !important;
    font-size:15px !important;
    border-radius:11px !important;
    box-shadow:0 5px 14px rgba(37,99,235,.22);
  }

  .btn-reset,
  .btn-secondary,
  .btn-primary,
  .btn-success,
  .flip-control,
  .quick-flip-btn{
    min-height:47px !important;
    font-size:14px !important;
    border-radius:11px !important;
  }

  .quick-flip-grid{
    grid-template-columns:1fr 1fr !important;
    gap:9px !important;
  }

  .info{
    min-height:44px !important;
    padding:9px 11px !important;
    border-radius:10px !important;
    background:rgba(255,255,255,.72) !important;
  }

  .info span,
  .info b{
    font-size:13px !important;
  }

  .image-preview{
    min-height:270px !important;
    border-radius:14px !important;
  }

  .image-preview img{
    max-height:250px !important;
  }

  .content-card{
    padding:19px !important;
  }

  .content-card h2{
    font-size:25px !important;
    line-height:1.3 !important;
    margin-bottom:18px !important;
  }

  .feature-grid,
  .steps-grid{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
  }

  .feature-item,
  .step{
    padding:17px !important;
    border:1.5px solid #dbeafe !important;
    border-radius:14px !important;
    background:linear-gradient(145deg,#ffffff,#f8fbff) !important;
    box-shadow:0 4px 14px rgba(15,23,42,.05);
  }

  .feature-item i{
    width:44px !important;
    height:44px !important;
    margin-bottom:10px !important;
    font-size:18px !important;
  }

  .feature-item h3,
  .step h3{
    font-size:18px !important;
  }

  .feature-item p,
  .step p{
    font-size:15px !important;
    line-height:1.65 !important;
  }

  .faq-card{
    padding:17px !important;
  }

  .faq-card summary{
    padding:16px 32px 16px 2px !important;
    font-size:16px !important;
    line-height:1.5 !important;
  }

  .faq-card summary::after{
    right:1px !important;
    top:12px !important;
  }

  .faq-card details p{
    padding:0 27px 17px 2px !important;
    font-size:15px !important;
    line-height:1.7 !important;
  }
}

@media (max-width:420px){

  .page-offset{
    padding-top:60px !important;
  }

  .tool-hero h1{
    font-size:29px !important;
  }

  .tool-hero p{
    font-size:14px !important;
  }

  .flip-card{
    padding:14px !important;
    border-radius:16px !important;
  }

  .flip-card h3{
    font-size:19px !important;
  }

  .upload-area{
    min-height:245px !important;
  }

  .quick-flip-grid{
    grid-template-columns:1fr !important;
  }

  .content-card{
    padding:16px !important;
    border-radius:16px !important;
  }

  .content-card h2{
    font-size:23px !important;
  }
}

/* Dark mode mobile */
@media (max-width:768px){
  html.otb-dark .flip-card,
  body.dark .flip-card{
    background:linear-gradient(145deg,#111827,#172033) !important;
    border-color:#334155 !important;
  }

  html.otb-dark .flip-card:nth-child(1),
  html.otb-dark .flip-card:nth-child(2),
  html.otb-dark .flip-card:nth-child(3),
  body.dark .flip-card:nth-child(1),
  body.dark .flip-card:nth-child(2),
  body.dark .flip-card:nth-child(3){
    border-color:#3b82f6 !important;
  }

  html.otb-dark .upload-area,
  body.dark .upload-area{
    background:#0f172a !important;
    border-color:#3b82f6 !important;
  }

  html.otb-dark .feature-item,
  html.otb-dark .step,
  body.dark .feature-item,
  body.dark .step{
    background:linear-gradient(145deg,#111827,#172033) !important;
    border-color:#334155 !important;
  }

  html.otb-dark .info,
  body.dark .info{
    background:#0f172a !important;
    border-color:#334155 !important;
  }
}
