/* =============================
   FULL TOOL APPLICATION LAYOUT
============================= */

body{
background:#f3f5f9;
}

.tool-app{
width:100%;
min-height:100vh;
padding:40px 20px 80px;
}

.tool-main{
max-width:1100px;
margin:0 auto;
}

/* HEADER */
.tool-header{
text-align:center;
margin-bottom:35px;
}

.tool-header h1{
font-size:44px;
font-weight:800;
margin-bottom:10px;
color:#1f2937;
}

.tool-header p{
font-size:17px;
color:#6b7280;
}

/* UPLOAD */
.upload-zone{
border:2px dashed #c7d2fe;
background:#ffffff;
padding:90px 20px;
border-radius:20px;
text-align:center;
cursor:pointer;
transition:.25s;
box-shadow:0 10px 35px rgba(0,0,0,.06);
}

.upload-zone:hover{
background:#eef2ff;
border-color:#2563eb;
transform:translateY(-2px);
}

.upload-icon{
font-size:48px;
margin-bottom:12px;
}

/* PRESETS */
.preset-section{
margin-top:35px;
text-align:center;
}

.preset-section h3{
margin-bottom:12px;
}

.preset-row{
display:flex;
gap:10px;
justify-content:center;
flex-wrap:wrap;
}

.preset{
background:#eef2ff;
border:none;
padding:12px 20px;
border-radius:12px;
cursor:pointer;
font-weight:600;
transition:.2s;
}

.preset:hover{
background:#2563eb;
color:#fff;
}

/* ADVANCED */
.advanced-section{
margin-top:30px;
}

details{
background:#ffffff;
border-radius:14px;
padding:18px;
box-shadow:0 8px 25px rgba(0,0,0,.05);
}

summary{
font-weight:700;
cursor:pointer;
margin-bottom:15px;
}

/* CONTROLS */
.controls{
display:grid;
grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
gap:16px;
}

.control-item{
display:flex;
flex-direction:column;
}

.control-item input{
margin-top:6px;
}

.check{
margin-top:10px;
}

.estimate{
margin-top:10px;
font-weight:600;
color:#2563eb;
}

/* ACTION */
.action-bar{
margin-top:30px;
text-align:center;
}

.primary-btn{
background:linear-gradient(135deg,#2563eb,#4f46e5);
color:#fff;
padding:15px 40px;
border:none;
border-radius:14px;
font-weight:700;
font-size:16px;
cursor:pointer;
box-shadow:0 12px 30px rgba(37,99,235,.35);
}

.secondary-btn{
background:#e5e7eb;
padding:15px 30px;
border:none;
border-radius:14px;
margin-left:10px;
font-weight:600;
cursor:pointer;
}

/* PROGRESS */
.progress{
height:8px;
background:#e5e7eb;
margin-top:18px;
border-radius:10px;
overflow:hidden;
}

.progress-bar{
height:100%;
width:0%;
background:#2563eb;
transition:.3s;
}

/* RESULTS */
.results-section{
margin-top:35px;
}

/* COMPARE */
.compare-section{
margin-top:45px;
text-align:center;
}

.compare-wrapper{
position:relative;
max-width:100%;
}

.compare-wrapper img{
width:100%;
border-radius:12px;
}

.compare-wrapper .after{
position:absolute;
top:0;
left:0;
clip-path: inset(0 50% 0 0);
}

#compareSlider{
width:100%;
margin-top:10px;
}

/* MOBILE */
@media(max-width:768px){

.tool-header h1{
font-size:32px;
}

.upload-zone{
padding:70px 15px;
}

.primary-btn,
.secondary-btn{
width:100%;
margin:10px 0 0 0;
}

.controls{
grid-template-columns:1fr;
}
}




/* ===== SELECTED FILE PREVIEW ===== */

.selected-files{
margin-top:25px;
background:#ffffff;
border-radius:16px;
padding:20px;
box-shadow:0 8px 25px rgba(0,0,0,.06);
}

.selected-files h3{
margin-bottom:15px;
text-align:center;
}

.preview-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
gap:14px;
}

.preview-item{
background:#f8fafc;
border-radius:12px;
padding:10px;
text-align:center;
border:1px solid #e5e7eb;
}

.preview-item img{
width:100%;
height:100px;
object-fit:cover;
border-radius:8px;
margin-bottom:6px;
}

.preview-name{
font-size:13px;
font-weight:600;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.preview-size{
font-size:12px;
color:#6b7280;
}




/* ===== RESULT CARDS ===== */

.result-card{
display:flex;
gap:16px;
align-items:center;
background:#ffffff;
padding:14px;
border-radius:14px;
box-shadow:0 8px 20px rgba(0,0,0,.05);
margin-top:14px;
}

.result-thumb{
position:relative;
width:120px;
}

.result-thumb img{
width:120px;
height:90px;
object-fit:cover;
border-radius:10px;
}

.saved-badge{
position:absolute;
top:6px;
left:6px;
background:#16a34a;
color:#fff;
padding:4px 8px;
font-size:12px;
border-radius:6px;
font-weight:700;
}

.result-info{
flex:1;
}

.file-name{
font-weight:700;
margin-bottom:4px;
}

.file-size{
font-size:14px;
color:#6b7280;
margin-bottom:8px;
}

.download-btn{
background:#2563eb;
color:#fff;
padding:8px 14px;
border-radius:8px;
text-decoration:none;
font-weight:600;
}




/* ===== DROP ZONE ACTIVE STATE ===== */

.upload-zone.active{
padding:20px;
border-style:solid;
}

.upload-preview-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(120px,1fr));
gap:12px;
margin-top:15px;
}

.upload-item{
position:relative;
background:#f3f4f6;
border-radius:10px;
padding:6px;
text-align:center;
}

.upload-item img{
width:100%;
height:90px;
object-fit:cover;
border-radius:8px;
}

.remove-btn{
position:absolute;
top:5px;
right:5px;
background:#ef4444;
color:#fff;
border:none;
border-radius:50%;
width:22px;
height:22px;
font-size:12px;
cursor:pointer;
}







/* ===== SEO CONTENT ===== */

.tool-seo{
max-width:900px;
margin:70px auto 40px;
background:#ffffff;
padding:35px;
border-radius:16px;
box-shadow:0 10px 30px rgba(0,0,0,.05);
line-height:1.7;
}

.tool-seo h2{
margin-top:28px;
margin-bottom:12px;
font-size:24px;
color:#111827;
}

.tool-seo p{
color:#374151;
margin-bottom:14px;
}

.tool-seo ul,
.tool-seo ol{
margin-left:20px;
margin-bottom:15px;
}




/* ===== FAQ SECTION ===== */

.faq-section{
max-width:900px;
margin:50px auto;
}

.faq-section h2{
text-align:center;
margin-bottom:20px;
}

.faq-item{
background:#fff;
border-radius:12px;
margin-bottom:12px;
box-shadow:0 6px 16px rgba(0,0,0,.05);
overflow:hidden;
}

.faq-question{
width:100%;
padding:16px;
text-align:left;
border:none;
background:#f9fafb;
font-weight:700;
cursor:pointer;
}

.faq-answer{
display:none;
padding:16px;
color:#374151;
}

.faq-item.active .faq-answer{
display:block;
}




/* ================================
   GRAMMAR CHECKER EDITOR
================================ */

/* editor container */
.upload-section{
max-width:900px;
margin:40px auto 10px;
text-align:center;
}

/* textarea editor */
#text{
width:100%;
min-height:260px;
padding:18px 18px;
border-radius:14px;
border:1px solid #e5e7eb;
font-size:16px;
line-height:1.6;
resize:vertical;
outline:none;
background:#ffffff;
box-shadow:0 10px 25px rgba(0,0,0,0.05);
transition:.25s;
}

/* focus effect */
#text:focus{
border-color:#4f46e5;
box-shadow:0 0 0 3px rgba(79,70,229,.18);
}

/* word counter */
.counter{
margin-top:10px;
font-size:14px;
color:#6b7280;
text-align:right;
}

/* buttons container */
.controls{
display:flex;
gap:12px;
justify-content:center;
flex-wrap:wrap;
margin-top:18px;
}

/* primary button */
.primary-btn{
background:linear-gradient(135deg,#2563eb,#4f46e5);
color:#fff;
border:none;
padding:14px 28px;
border-radius:12px;
font-weight:700;
cursor:pointer;
transition:.25s;
box-shadow:0 8px 20px rgba(37,99,235,.35);
}

.primary-btn:hover{
transform:translateY(-2px);
box-shadow:0 12px 28px rgba(37,99,235,.45);
}

/* secondary buttons */
.secondary-btn{
background:#eef2ff;
color:#1f2937;
border:none;
padding:14px 24px;
border-radius:12px;
font-weight:600;
cursor:pointer;
transition:.2s;
}

.secondary-btn:hover{
background:#e0e7ff;
transform:translateY(-2px);
}

/* results box */
#results{
max-width:900px;
margin:30px auto;
padding:20px;
border-radius:14px;
background:#ffffff;
box-shadow:0 12px 30px rgba(0,0,0,0.05);
text-align:left;
line-height:1.7;
font-size:16px;
}

/* corrected text highlight */
.corrected{
background:#dcfce7;
padding:2px 4px;
border-radius:5px;
}

.error{
background:#fee2e2;
padding:2px 4px;
border-radius:5px;
}

/* mobile */
@media(max-width:768px){

#text{
min-height:220px;
font-size:15px;
}

.controls{
gap:10px;
}

.primary-btn,
.secondary-btn{
width:100%;
}

}
.upload-success{
  text-align:center;
}

.upload-check{
  font-size:38px;
  color:#22c55e;
  margin-bottom:8px;
}

.thumb-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(90px,1fr));
  gap:10px;
  margin-top:15px;
}

.thumb{
  width:100%;
  border-radius:10px;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}
.upload-success{text-align:center;}
.upload-check{font-size:38px;color:#22c55e;margin-bottom:8px;}

.thumb-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(90px,1fr));
gap:10px;
margin-top:15px;
}

.thumb{
width:100%;
border-radius:10px;
box-shadow:0 4px 12px rgba(0,0,0,.15);
}
/* drop preview */
.upload-preview-wrap{
width:100%;
}

.upload-top{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:10px;
font-weight:600;
}

.upload-ok{
color:#22c55e;
}

.add-more{
background:#eef2ff;
border:none;
padding:6px 12px;
border-radius:8px;
cursor:pointer;
font-weight:600;
}

.upload-preview-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(100px,1fr));
gap:12px;
}

.upload-thumb{
position:relative;
}

.upload-thumb img{
width:100%;
height:90px;
object-fit:cover;
border-radius:10px;
box-shadow:0 6px 14px rgba(0,0,0,.2);
}

.remove-thumb{
position:absolute;
top:-8px;
right:-8px;
background:#ef4444;
color:#fff;
border:none;
width:22px;
height:22px;
border-radius:50%;
cursor:pointer;
font-weight:bold;
}



.tools-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:18px;
    margin-top:25px;
}


.tool-card{
    text-decoration:none;
    color:#111;
}

.tool-card-inner{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:20px;
    text-align:center;
    transition:0.2s ease;
}

.tool-card-inner:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
    border-color:#6366f1;
}

.tool-icon{
    font-size:32px;
    margin-bottom:10px;
}

.tool-open{
    display:inline-block;
    margin-top:10px;
    color:#6366f1;
    font-size:14px;
}

/* ===== IMAGE VIEWER FRAME (IMPORTANT FIX) ===== */

.preview-wrap{
    display:flex;
    gap:25px;
    flex-wrap:wrap;
    margin-top:25px;
}

.preview-box{
    flex:1;
    min-width:300px;
}

.image-frame{
    width:100%;
    height:420px;
    background:#f4f6fb;
    border-radius:14px;
    border:2px dashed #d8deea;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    position:relative;
}

/* real magic */
.image-frame img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    display:block;
}

/* mobile */
@media(max-width:768px){
    .image-frame{
        height:300px;
    }
}




#beforeImg,
#afterImg{
    display:none;
}

.image-frame.has-image img{
    display:block;
}




.conversion-box{
    background:#fff;
    padding:25px;
    border-radius:12px;
    box-shadow:0 8px 20px rgba(0,0,0,0.05);
    max-width:600px;
    margin:40px auto;
    text-align:center;
}

.progress-bar{
    width:100%;
    height:8px;
    background:#eee;
    border-radius:10px;
    margin:15px 0 20px;
    overflow:hidden;
}

#progressFill{
    width:0%;
    height:100%;
    background:linear-gradient(90deg,#4f46e5,#9333ea);
    transition:width 0.3s;
}



/* PDF UI */

.pdf-results{
    margin-top:30px;
}

.pdf-status{
    background:#f5f7ff;
    padding:20px;
    border-radius:12px;
    text-align:center;
    margin-bottom:25px;
}

.progress-wrap{
    width:100%;
    height:14px;
    background:#e2e6ff;
    border-radius:10px;
    overflow:hidden;
    margin:10px 0;
}

#progressFill{
    height:100%;
    width:0%;
    background:linear-gradient(90deg,#4f7cff,#7a5cff);
    transition:width .3s;
}

.pages-list{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
    gap:18px;
}

.page-card{
    background:white;
    border-radius:12px;
    padding:12px;
    box-shadow:0 4px 12px rgba(0,0,0,.08);
    text-align:center;
}

.page-card img{
    width:100%;
    height:200px;
    object-fit:contain;
    border-radius:8px;
    background:#f3f3f3;
}

.page-card button{
    margin-top:10px;
    width:100%;
}

.download-bar{
    margin-top:25px;
    text-align:center;
}




/* Loan Calculator */

.calculator-box{
    max-width:500px;
    margin:20px auto;
    background:#fff;
    padding:25px;
    border-radius:12px;
    box-shadow:0 4px 15px rgba(0,0,0,.08);
}

.form-group{
    margin-bottom:15px;
}

.form-group label{
    display:block;
    margin-bottom:6px;
    font-weight:600;
}

.form-group input{
    width:100%;
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
}

.calc-btn{
    width:100%;
    padding:12px;
    background:#4CAF50;
    color:#fff;
    border:none;
    border-radius:8px;
    font-weight:bold;
    cursor:pointer;
}

.result-box{
    max-width:500px;
    margin:25px auto;
    background:#f9f9f9;
    padding:20px;
    border-radius:12px;
}




/* ===== Loan Calculator ===== */

.loan-wrapper{
    display:flex;
    flex-wrap:wrap;
    gap:25px;
    margin-top:25px;
}

.loan-inputs{
    flex:1;
    min-width:260px;
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.field{
    margin-bottom:18px;
}

.field label{
    display:block;
    margin-bottom:6px;
    font-weight:600;
}

.field input{
    width:100%;
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
}

.loan-results{
    flex:1;
    min-width:260px;
    display:grid;
    gap:15px;
}

.result-card{
    background:#ffffff;
    padding:18px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.result-card span{
    color:#666;
}

.result-card h2{
    margin:6px 0 0;
    color:#2c7be5;
}

.chart-box{
    margin:30px auto;
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
    max-width:520px;
    height:360px;
    position:relative;
}

.chart-box canvas{
    width:100% !important;
    height:100% !important;
}





.loan-types{
    text-align:center;
    margin-bottom:15px;
}

.loan-types button{
    padding:8px 14px;
    margin:4px;
    border:none;
    background:#eef3ff;
    color:#2c7be5;
    border-radius:8px;
    cursor:pointer;
    font-weight:600;
}

.loan-types button:hover{
    background:#2c7be5;
    color:#fff;
}

.table-box{
    margin-top:30px;
}

.table-wrap{
    overflow:auto;
    max-height:420px;
    background:#fff;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

table{
    width:100%;
    border-collapse:collapse;
}

th,td{
    padding:10px;
    text-align:center;
    border-bottom:1px solid #eee;
}

thead{
    background:#f4f6f9;
    position:sticky;
    top:0;
}

/* GST Calculator */

.gst-box{
    max-width:520px;
    margin:25px auto;
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.gst-mode{
    display:flex;
    gap:20px;
    margin-bottom:15px;
}

.gst-rates{
    margin:10px 0;
    text-align:center;
}

.gst-rates button{
    padding:8px 14px;
    margin:4px;
    border:none;
    border-radius:8px;
    background:#eef3ff;
    color:#2c7be5;
    font-weight:600;
    cursor:pointer;
}

.gst-rates button:hover{
    background:#2c7be5;
    color:#fff;
}

.gst-result{
    max-width:700px;
    margin:25px auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
    gap:15px;
}

.gst-card{
    background:#fff;
    padding:18px;
    text-align:center;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.gst-card span{
    color:#666;
}











/* Age Calculator */

.age-box{
    max-width:520px;
    margin:25px auto;
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.age-results{
    max-width:900px;
    margin:25px auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
    gap:15px;
}

.age-card{
    background:#fff;
    padding:18px;
    text-align:center;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.age-card span{
    color:#666;
}




/* Percentage Calculator */

.percent-box{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:18px;
    margin-top:25px;
}

.percent-card{
    background:#fff;
    padding:18px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
    text-align:center;
}

.percent-card input{
    width:100%;
    margin:8px 0;
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
}

.result{
    margin-top:10px;
    font-weight:bold;
    color:#2c7be5;
}




/* Word Counter Upgrade */

/* ===== Word Counter Editor ===== */

.wc-box-main{
    max-width:1000px;
    margin:20px auto;
    text-align:center;
}

#textInput{
    width:100%;
    min-height:260px;
    resize:vertical;
    padding:18px;
    font-size:16px;
    line-height:1.6;
    border:1px solid #dcdcdc;
    border-radius:12px;
    outline:none;
    background:#ffffff;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

#textInput:focus{
    border-color:#2c7be5;
    box-shadow:0 0 0 3px rgba(44,123,229,.15);
}

/* buttons */
.wc-actions{
    margin-top:15px;
}

.wc-actions button{
    padding:10px 18px;
    margin:6px;
    border:none;
    border-radius:8px;
    background:#2c7be5;
    color:#fff;
    font-weight:600;
    cursor:pointer;
    transition:.2s;
}

.wc-actions button:hover{
    background:#1a5fd1;
}

/* stats cards */
.wc-stats{
    max-width:1100px;
    margin:25px auto;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
    gap:15px;
}

.wc-box{
    background:#ffffff;
    padding:18px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.wc-box strong{
    display:block;
    font-size:22px;
    margin-top:5px;
    color:#2c7be5;
}






/* Mortgage Calculator */

.mortgage-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.mortgage-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.mortgage-form label{
    font-weight:600;
    margin-top:12px;
    display:block;
}

.mortgage-form input{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.mortgage-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.mortgage-result{
    display:grid;
    gap:15px;
}

.m-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.m-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}






/* Tip Calculator */

.tip-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.tip-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.tip-form label{
    font-weight:600;
    margin-top:12px;
    display:block;
}

.tip-form input,
.tip-form select{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.tip-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.tip-result{
    display:grid;
    gap:15px;
}

.t-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.t-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}






/* Date Calculator */

.date-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.date-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.date-form label{
    margin-top:12px;
    display:block;
    font-weight:600;
}

.date-form input{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.date-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.date-result{
    display:grid;
    gap:15px;
}

.d-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.d-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}







/* Compound Interest */

.compound-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.compound-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.compound-form label{
    margin-top:12px;
    display:block;
    font-weight:600;
}

.compound-form input,
.compound-form select{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.compound-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.compound-result{
    display:grid;
    gap:15px;
}

.c-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.c-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}



/* Retirement Calculator */

.retire-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.retire-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.retire-form label{
    margin-top:12px;
    display:block;
    font-weight:600;
}

.retire-form input{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.retire-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.retire-result{
    display:grid;
    gap:15px;
}

.r-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.r-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}



/* BMI Calculator */

.bmi-box{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:25px;
    max-width:1000px;
    margin:30px auto;
}

.bmi-form{
    background:#fff;
    padding:20px;
    border-radius:14px;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.bmi-form label{
    margin-top:12px;
    display:block;
    font-weight:600;
}

.bmi-form input,
.bmi-form select{
    width:100%;
    padding:10px;
    margin-top:6px;
    border:1px solid #ddd;
    border-radius:8px;
}

.bmi-form button{
    margin-top:18px;
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:#2c7be5;
    color:#fff;
    font-weight:bold;
    cursor:pointer;
}

.bmi-result{
    display:grid;
    gap:15px;
}

.b-card{
    background:#fff;
    padding:20px;
    border-radius:14px;
    text-align:center;
    box-shadow:0 4px 14px rgba(0,0,0,.08);
}

.b-card strong{
    display:block;
    font-size:24px;
    margin-top:8px;
    color:#2c7be5;
}



/* =================================
   FULL WIDTH TOOL PAGES (MARKETPLACE)
================================= */

.tool-layout.fullwidth{
    display:block;
    max-width:1400px;
    margin:0 auto;
    padding:20px;
}

/* make main expand */
.tool-layout.fullwidth .tool-main{
    width:100%;
    max-width:100%;
    margin:0 auto;
}

/* hero alignment */
.tool-layout.fullwidth .tool-hero{
    text-align:center;
    margin-bottom:25px;
}

/* search box */
.tool-search{
    width:100%;
    padding:14px 16px;
    border-radius:12px;
    border:1px solid #d1d5db;
    margin:20px 0 25px;
    font-size:15px;
}

/* grid wider for store pages */
.tool-layout.fullwidth .tools-grid{
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
}

/* pagination center */
.tool-layout.fullwidth .pagination{
    text-align:center;
    margin:40px 0;
}


.store-container{
    width:100%;
}


/* ===== TDL STORE PAGE ===== */

.tool-layout.fullwidth{
    background:transparent !important;
    padding-top:30px;
}
/* header area */
.tool-layout.fullwidth .tool-hero{
    background:#ffffff;
    padding:35px 25px;
    border-radius:18px;
    box-shadow:0 12px 30px rgba(0,0,0,.06);
    margin-bottom:25px;
}

.tool-layout.fullwidth .tool-hero h1{
    font-size:36px;
}

.tool-layout.fullwidth .tool-hero p{
    max-width:800px;
    margin:8px auto;
}




/* filter tabs */
.tdl-filters{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:center;
    margin:20px 0 25px;
}

.tdl-filters a{
    padding:10px 18px;
    background:#eef2ff;
    border-radius:999px;
    text-decoration:none;
    font-weight:600;
    color:#374151;
    transition:.2s;
}

.tdl-filters a:hover{
    background:#2563eb;
    color:#fff;
}

.tool-search{
    background:#ffffff;
    border:1px solid #e5e7eb;
    box-shadow:0 6px 16px rgba(0,0,0,.05);
}

/* marketplace cards */
.tool-layout.fullwidth .tool-card-inner{
    padding:22px;
    border-radius:16px;
    border:1px solid #e5e7eb;
    transition:.25s;
    height:100%;
}

.tool-layout.fullwidth .tool-card-inner h3{
    font-size:18px;
    margin-bottom:8px;
}

.tool-layout.fullwidth .tool-card-inner p{
    font-size:14px;
    color:#6b7280;
    min-height:40px;
}

.tool-layout.fullwidth .tool-card-inner:hover{
    transform:translateY(-6px);
    box-shadow:0 18px 35px rgba(0,0,0,.10);
    border-color:#6366f1;
}

/* download badge */
.tool-open{
    display:inline-block;
    margin-top:12px;
    background:#2563eb;
    color:#fff;
    padding:8px 14px;
    border-radius:10px;
    font-size:13px;
}





/* =========================
   TDL STORE PRODUCT CARDS
========================= */

.tools-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:22px;
}

/* main card */
.tool-card{
    text-decoration:none;
    color:#111;
}

.tool-card-inner{
    background:#ffffff;
    border-radius:18px;
    padding:18px 18px 16px;
    border:1px solid #e5e7eb;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    height:100%;
    transition:.25s;
}

/* hover effect */
.tool-card-inner:hover{
    transform:translateY(-6px);
    box-shadow:0 18px 40px rgba(0,0,0,.12);
    border-color:#6366f1;
}

/* title */
.tool-title{
    font-size:17px;
    font-weight:700;
    margin-bottom:8px;
}

/* description */
.tool-desc{
    font-size:14px;
    color:#6b7280;
    line-height:1.5;
    min-height:44px;
}

/* footer */
.tool-card-footer{
    margin-top:14px;
    display:flex;
    justify-content:center;
}

/* button */
.tool-download{
    background:#2563eb;
    color:#fff;
    padding:9px 16px;
    border-radius:10px;
    font-weight:600;
    font-size:14px;
}



/* ================================
   TDL STORE CARD LAYOUT FIX
================================ */

/* remove inner grey box feeling */
.tool-layout.fullwidth .tool-card{
    display:block;
    height:100%;
}

/* vertical layout */
.tool-layout.fullwidth .tool-card-inner{
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    align-items:flex-start;   /* important */
    text-align:left;          /* important */
    height:100%;
    padding:18px;
}

/* title */
.tool-layout.fullwidth .tool-title{
    font-size:17px;
    font-weight:700;
    margin-bottom:6px;
}

/* SHOW DESCRIPTION (this is the main fix) */
.tool-layout.fullwidth .tool-desc{
    display:block;
    font-size:14px;
    color:#6b7280;
    line-height:1.5;
    margin-bottom:14px;
}

/* push button to bottom */
.tool-layout.fullwidth .tool-card-footer{
    margin-top:auto;
    width:100%;
}

/* download button */
.tool-layout.fullwidth .tool-download{
    display:inline-block;
    background:#2563eb;
    color:#fff;
    padding:9px 14px;
    border-radius:10px;
    font-size:14px;
    font-weight:600;
}




/* ==========================================
   FORCE TDL STORE TO USE PRODUCT CARD LAYOUT
========================================== */

/* kill old centered card behavior */
.tool-layout.fullwidth .tool-card-inner{
    text-align:left !important;
    align-items:flex-start !important;
    justify-content:flex-start !important;
}

/* ensure content flows vertically */
.tool-layout.fullwidth .tool-card-body{
    width:100%;
    display:block;
}

/* FORCE description visible */
.tool-layout.fullwidth .tool-desc{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    height:auto !important;
    margin-top:6px;
    margin-bottom:14px;
    color:#6b7280;
    font-size:14px;
    line-height:1.5;
}

/* proper spacing */
.tool-layout.fullwidth .tool-title{
    margin-bottom:4px;
}

/* move button to bottom */
.tool-layout.fullwidth .tool-card-footer{
    margin-top:auto;
}




/* ===== TDL PRODUCT PAGE ===== */

.tdl-product{
    display:grid;
    grid-template-columns: 1fr 320px;
    gap:40px;
    margin-top:30px;
}

.tdl-left{
    background:#fff;
    padding:32px;
    border-radius:18px;
    box-shadow:0 12px 30px rgba(0,0,0,.06);
}

.tdl-left h1{
    font-size:34px;
    margin-bottom:8px;
}

.tool-meta{
    color:#2563eb;
    font-weight:600;
    margin-bottom:12px;
}

.tool-short{
    font-size:18px;
    margin-bottom:20px;
}

.tool-long{
    line-height:1.8;
    color:#374151;
}

/* features */

.feature-list{
    list-style:none;
    padding:0;
    margin-top:10px;
}

.feature-list li{
    padding:8px 0;
    border-bottom:1px solid #eee;
}

/* install */
.install-steps li{
    margin-bottom:8px;
}

/* RIGHT SIDE */

.download-box{
    position:sticky;
    top:110px;
    background:#fff;
    padding:24px;
    border-radius:18px;
    box-shadow:0 18px 40px rgba(0,0,0,.12);
}

.download-title{
    font-size:22px;
    font-weight:700;
    margin-bottom:15px;
}

.download-meta{
    margin-bottom:18px;
}

.download-meta div{
    margin-bottom:6px;
}

.download-btn-big{
    display:block;
    text-align:center;
    background:linear-gradient(135deg,#2563eb,#4f46e5);
    color:#fff;
    padding:14px;
    border-radius:12px;
    font-weight:700;
    text-decoration:none;
    margin-bottom:12px;
}

.safe-note{
    text-align:center;
    color:#16a34a;
    font-size:13px;
}

.back-btn{
    display:inline-block;
    margin-top:30px;
    background:#e5e7eb;
    padding:10px 16px;
    border-radius:10px;
    text-decoration:none;
    color:#111;
}

/* mobile */
@media(max-width:900px){
    .tdl-product{
        grid-template-columns:1fr;
    }
}



.tool-icon-img{
    width:64px;
    height:64px;
    object-fit:contain;
    margin-bottom:12px;
}


.tool-icon-emoji{
font-size:42px;
margin-bottom:12px;
display:block;
}

/* PDF SPLIT MODERN FIX */

.workspace-card{
    background:#ffffff;
    padding:30px;
    border-radius:18px;
    box-shadow:0 10px 30px rgba(0,0,0,.06);
    margin-top:25px;
}

.workspace-controls{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    justify-content:center;
    margin:20px 0;
}

.workspace-controls input{
    padding:12px 14px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    min-width:220px;
}

.workspace-drop{
    border:2px dashed #c7d2fe;
    background:#f8faff;
    padding:50px 20px;
    text-align:center;
    border-radius:18px;
    cursor:pointer;
    margin-top:20px;
    transition:.25s;
}

.workspace-drop:hover{
    border-color:#2563eb;
    background:#eef2ff;
}

.workspace-drop input{
    display:none;
}





/* HOME TOOL CARDS MODERN */

.tools-section{
    margin-top:60px;
}

.tools-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
    gap:22px;
    margin-top:25px;
}

.tool-card-inner{
    background:#ffffff;
    border-radius:18px;
    padding:24px 18px;
    text-align:center;
    border:1px solid #e5e7eb;
    transition:.25s;
    height:100%;
}

.tool-card-inner:hover{
    transform:translateY(-6px);
    box-shadow:0 18px 35px rgba(0,0,0,.12);
    border-color:#6366f1;
}

.tool-icon-emoji{
    font-size:42px;
    margin-bottom:10px;
}

.tool-card-inner h3{
    font-size:17px;
    margin-bottom:8px;
}

.tool-open{
    color:#2563eb;
    font-weight:600;
    font-size:14px;
}



/* =========================
   FIX TOOL CARD BUTTON TEXT
========================= */

.tools-grid .tool-card {
    text-decoration: none;
}

.tools-grid .tool-open {
    display: inline-block;
    background: #2563eb;
    color: #ffffff !important;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Prevent parent link hover from overriding */
.tools-grid .tool-card:hover .tool-open {
    background: #1d4ed8;
    color: #ffffff !important;
}