/* ==========================================================================
   FREE TOOLS — design system for the tool pages.
   Mobile first. Sharp edges. Site palette only.
   Every control the tools use is styled here, so a new tool written with the
   same class names looks right without adding any CSS.
   ========================================================================== */

.tool-page{background:var(--light-gray);padding:0 0 44px}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.tool-hero{background:var(--secondary);padding:30px 0 44px;position:relative}
.tool-hero .container{position:relative;z-index:1}
.tool-hero .crumb{margin-bottom:14px}
.tool-hero .crumb a,.tool-hero .crumb span{color:rgba(255,255,255,.6)}
.tool-hero .crumb a:hover{color:#fff}
.tool-hero .crumb svg{width:12px;height:12px;opacity:.5}
.tool-hero-main{display:flex;gap:14px;align-items:flex-start}
.tool-hero-ico{
  width:46px;height:46px;flex:0 0 auto;display:grid;place-items:center;
  background:var(--primary);color:#fff;
}
.tool-hero-ico .ticon{width:23px;height:23px}
.tool-hero h1{color:#fff;font-size:clamp(1.35rem,5.2vw,2.05rem);line-height:1.15;margin:0 0 7px;font-weight:700}
.tool-hero p{color:rgba(255,255,255,.75);font-size:clamp(.88rem,3.1vw,1rem);line-height:1.6;max-width:64ch;margin:0}
.tool-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:16px}
.tool-badge{
  display:inline-flex;align-items:center;gap:6px;
  border:1px solid rgba(255,255,255,.2);padding:5px 10px;
  font-size:.73rem;color:rgba(255,255,255,.85);white-space:nowrap;
}
.tool-badge .ticon{width:13px;height:13px;color:var(--accent)}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.tool-layout{display:grid;gap:16px;margin-top:-22px;position:relative;z-index:2}
.tool-main{min-width:0}
.tool-side{display:grid;gap:14px;align-content:start}

.tool-card{background:var(--white);border:1px solid var(--border);padding:18px 16px;margin-bottom:16px}
.tool-card:last-child{margin-bottom:0}
.tool-card-title{
  display:flex;align-items:center;gap:9px;margin:0 0 14px;
  font-size:.95rem;font-weight:650;color:var(--ink);
}
.tool-card-title .ticon{width:17px;height:17px;color:var(--primary)}
.tool-card-note{font-size:.82rem;color:var(--muted);margin:-8px 0 14px;line-height:1.55}

/* ── Drop zone ──────────────────────────────────────────────────────────── */
.tool-drop{
  border:2px dashed var(--border);background:var(--light-gray);
  padding:28px 16px;text-align:center;cursor:pointer;display:block;
  transition:border-color .16s ease,background .16s ease;
}
.tool-drop:hover,.tool-drop.dragover{border-color:var(--primary);background:var(--accent-soft)}
.tool-drop-ico{width:38px;height:38px;margin:0 auto 10px;color:var(--primary);display:block}
.tool-drop-ico .ticon{width:38px;height:38px}
.tool-drop-title{font-size:1rem;font-weight:650;color:var(--ink);margin:0 0 4px}
.tool-drop-sub{font-size:.85rem;color:var(--muted);margin:0}
.tool-drop-hint{font-size:.76rem;color:var(--faint);margin:7px 0 0}
.tool-drop-hint kbd{
  font-family:var(--f-mono);font-size:.72rem;background:var(--white);
  border:1px solid var(--border);padding:1px 5px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.tbtn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  font-family:inherit;font-size:.9rem;font-weight:600;line-height:1;
  padding:12px 18px;border:1px solid transparent;cursor:pointer;
  background:var(--primary);color:#fff;transition:background .15s ease,border-color .15s ease;
}
.tbtn:hover{background:var(--primary-dark);color:#fff}
.tbtn .ticon{width:16px;height:16px}
.tbtn:disabled,.tbtn[disabled]{background:var(--border);color:var(--faint);cursor:not-allowed}
.tbtn-ghost{background:var(--white);color:var(--ink-2);border-color:var(--border)}
.tbtn-ghost:hover{background:var(--light-gray);border-color:var(--gray);color:var(--ink)}
.tbtn-lg{width:100%;padding:15px 20px;font-size:.98rem}
.tbtn-row{display:flex;flex-wrap:wrap;gap:10px}

/* ── Options ────────────────────────────────────────────────────────────── */
.tool-options{display:grid;gap:12px}
.topt{display:flex;flex-direction:column;gap:6px;min-width:0}
.topt label{
  display:flex;align-items:center;gap:6px;
  font-size:.76rem;font-weight:600;color:var(--muted);
  text-transform:uppercase;letter-spacing:.04em;
}
.topt label .ticon{width:14px;height:14px;color:var(--primary)}
.topt select,.topt input{
  width:100%;font-family:inherit;font-size:.92rem;color:var(--ink);
  padding:10px 12px;border:1px solid var(--border);background:var(--white);
  transition:border-color .15s ease,box-shadow .15s ease;
}
.topt select{
  appearance:none;cursor:pointer;padding-right:32px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5058' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;background-size:15px;
}
.topt select:hover,.topt input:hover{border-color:var(--gray)}
.topt select:focus,.topt input:focus{
  outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(46,155,120,.14);
}
.tool-inputline{display:grid;gap:10px}
.tool-inputline input[type=text]{
  width:100%;font-family:inherit;font-size:1rem;color:var(--ink);
  padding:14px 15px;border:1px solid var(--border);background:var(--white);
}
.tool-inputline input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(46,155,120,.14)}

/* ── Status ─────────────────────────────────────────────────────────────── */
.tool-status{display:grid;gap:1px;background:var(--border);border:1px solid var(--border);margin-top:14px}
.tstat{background:var(--white);padding:11px 13px;display:flex;align-items:center;gap:8px;min-width:0}
.tstat .ticon{width:15px;height:15px;color:var(--primary);flex:0 0 auto}
.tstat span{font-size:.83rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tstat b{color:var(--ink);font-weight:650}

.tool-progress{height:5px;background:var(--border);margin-top:14px;overflow:hidden}
.tool-progress span{display:block;height:100%;width:0;background:var(--primary);transition:width .25s ease}

/* ── Previews ───────────────────────────────────────────────────────────── */
.tool-previews{
  display:grid;gap:10px;margin-top:14px;
  grid-template-columns:repeat(auto-fill,minmax(min(45%,120px),1fr));
}
.preview-item{position:relative;border:1px solid var(--border);background:var(--white);overflow:hidden}
.preview-item img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block}
.preview-item .pv-meta{padding:7px 8px;font-size:.7rem;color:var(--muted);line-height:1.35}
.preview-item .pv-meta b{
  display:block;color:var(--ink);font-weight:600;font-size:.72rem;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.preview-item .remove-btn{
  position:absolute;top:5px;right:5px;width:26px;height:26px;
  display:grid;place-items:center;cursor:pointer;background:rgba(26,26,26,.72);color:#fff;border:0;
}
.preview-item .remove-btn:hover{background:#B42318}
.preview-item .remove-btn .ticon{width:14px;height:14px}
.pv-move{position:absolute;top:5px;left:5px;display:flex;gap:3px}
.pv-move button{
  width:26px;height:26px;display:grid;place-items:center;cursor:pointer;
  background:rgba(26,26,26,.72);color:#fff;border:0;
}
.pv-move button:hover{background:var(--primary)}
.pv-move .ticon{width:13px;height:13px}
.pv-index{
  position:absolute;left:5px;bottom:38px;background:var(--primary);color:#fff;
  font-family:var(--f-mono);font-size:.62rem;padding:2px 6px;
}

.tool-results{display:grid;gap:10px;margin-top:14px}
.tres{
  display:grid;grid-template-columns:48px 1fr;gap:11px;align-items:center;
  border:1px solid var(--border);background:var(--white);padding:10px;
}
.tres img{width:48px;height:48px;object-fit:cover;display:block;border:1px solid var(--border)}
.tres-body{min-width:0}
.tres-name{font-size:.84rem;font-weight:600;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tres-size{font-size:.77rem;color:var(--muted);margin-top:2px}
.tres-size .down{color:var(--primary);font-weight:650}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.tside-card{background:var(--white);border:1px solid var(--border);padding:16px}
.tside-title{
  font-family:var(--f-mono);font-size:.65rem;letter-spacing:.11em;text-transform:uppercase;
  color:var(--muted);margin:0 0 12px;
}
.tside-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.tside-list li{display:flex;gap:9px;align-items:flex-start;font-size:.85rem;color:var(--ink-2);line-height:1.5}
.tside-list .ticon{width:15px;height:15px;color:var(--primary);flex:0 0 auto;margin-top:2px}

.tool-ad{background:var(--white);border:1px solid var(--border);padding:12px;text-align:center}
.tool-ad-label{
  font-family:var(--f-mono);font-size:.6rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--faint);margin-bottom:8px;
}

/* ── Notes ──────────────────────────────────────────────────────────────── */
.tool-note{
  display:flex;gap:10px;align-items:flex-start;
  border-left:3px solid var(--primary);background:var(--accent-soft);
  padding:12px 14px;font-size:.85rem;color:var(--ink-2);line-height:1.6;margin-top:16px;
}
.tool-note .ticon{width:16px;height:16px;color:var(--primary);flex:0 0 auto;margin-top:1px}
.tool-msg{font-size:.85rem;margin-top:12px;padding:10px 12px}
.tool-msg-ok{background:var(--accent-soft);color:var(--primary-dark);border-left:3px solid var(--primary)}
.tool-msg-err{background:#FEF3F2;color:#912018;border-left:3px solid #B42318}

/* ── QR stage ───────────────────────────────────────────────────────────── */
.qr-stage{border:1px solid var(--border);background:var(--light-gray);padding:22px 16px;text-align:center;margin-top:14px}
.qr-stage canvas{width:100%;max-width:250px;height:auto;display:block;margin:0 auto;background:#fff;border:1px solid var(--border)}
.qr-stage-empty{color:var(--muted);font-size:.86rem;padding:34px 0}
.qr-stage-cap{font-size:.78rem;color:var(--muted);margin-top:12px}

/* ── Content block ──────────────────────────────────────────────────────── */
.tool-content{background:var(--white);border:1px solid var(--border);padding:20px 16px;margin-top:16px}
.tool-content h2{font-size:1.1rem;font-weight:700;color:var(--ink);margin:0 0 10px}
.tool-content h3{font-size:.96rem;font-weight:650;color:var(--ink);margin:20px 0 7px}
.tool-content p{font-size:.9rem;color:var(--muted);line-height:1.75;margin:0 0 12px}
.tool-content ul{margin:0 0 12px;padding-left:1.2rem}
.tool-content li{font-size:.9rem;color:var(--muted);line-height:1.7;margin-bottom:6px}
.tool-faq{display:grid;gap:1px;background:var(--border);border:1px solid var(--border);margin-top:14px}
.tool-faq details{background:var(--white)}
.tool-faq summary{
  padding:13px 15px;cursor:pointer;font-size:.9rem;font-weight:600;color:var(--ink);
  list-style:none;display:flex;justify-content:space-between;gap:10px;align-items:center;
}
.tool-faq summary::-webkit-details-marker{display:none}
.tool-faq summary::after{content:"+";font-size:1.15rem;color:var(--primary);font-weight:400;line-height:1}
.tool-faq details[open] summary::after{content:"\2212"}
.tool-faq details p{padding:0 15px 14px;margin:0;font-size:.88rem;color:var(--muted);line-height:1.7}

/* ── Hub tiles ──────────────────────────────────────────────────────────── */
.tool-grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr))}
.tool-tile{
  display:flex;flex-direction:column;gap:8px;
  background:var(--white);border:1px solid var(--border);padding:20px 18px;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.tool-tile:hover{border-color:var(--accent);box-shadow:var(--box-shadow);transform:translateY(-2px)}
.tool-tile-ico{
  width:40px;height:40px;display:grid;place-items:center;margin-bottom:4px;
  background:var(--accent-soft);color:var(--primary);border:1px solid #CFE3DA;
}
.tool-tile-ico .ticon{width:20px;height:20px}
.tool-tile h3{font-size:1rem;font-weight:650;margin:0;color:var(--ink)}
.tool-tile p{font-size:.86rem;color:var(--muted);line-height:1.6;margin:0}
.tool-tile-go{
  margin-top:auto;padding-top:10px;display:inline-flex;align-items:center;gap:6px;
  font-size:.84rem;font-weight:600;color:var(--primary);
}
.tool-tile-go .ticon{width:15px;height:15px;transition:transform .18s ease}
.tool-tile:hover .tool-tile-go .ticon{transform:translateX(3px)}

.ticon{width:1em;height:1em;flex:0 0 auto;vertical-align:-.14em}

/* ── Larger screens ─────────────────────────────────────────────────────── */
@media (min-width:600px){
  .tool-card{padding:22px 20px}
  .tool-options{grid-template-columns:1fr 1fr}
  .tool-status{grid-template-columns:repeat(3,1fr)}
  .tool-inputline{grid-template-columns:1fr auto;align-items:center}
  .tbtn-lg{width:auto;min-width:220px}
  .tool-content{padding:24px 22px}
  .tool-previews{grid-template-columns:repeat(auto-fill,minmax(130px,1fr))}
}
@media (min-width:900px){
  .tool-hero{padding:38px 0 52px}
  .tool-hero-ico{width:54px;height:54px}
  .tool-hero-ico .ticon{width:27px;height:27px}
  .tool-layout{grid-template-columns:minmax(0,1fr) 296px;gap:20px}
  .tool-options{grid-template-columns:repeat(4,1fr)}
}

/* the tools' own logic toggles this class to show and hide sections */
.hidden{display:none !important}

/* The compressor renders its own card markup, so it gets matching styles
   rather than being forced to use the same class names as the PDF tool. */
.image-card{position:relative;border:1px solid var(--border);background:var(--white);overflow:hidden}
.image-card img{width:100%;aspect-ratio:1/1;object-fit:cover;display:block}
.image-card .card-info{padding:8px 9px;display:grid;gap:5px}
.image-card .filename{
  font-size:.75rem;font-weight:600;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.image-card .filesize{font-family:var(--f-mono);font-size:.68rem;color:var(--muted)}
.image-card .remove-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  width:100%;padding:6px 8px;cursor:pointer;
  background:var(--white);border:1px solid var(--border);color:var(--muted);
  font-family:inherit;font-size:.72rem;font-weight:600;
  transition:background .14s ease,color .14s ease,border-color .14s ease;
}
.image-card .remove-btn:hover{background:#FEF3F2;border-color:#FECDCA;color:#B42318}
.image-card .remove-btn .ticon{width:12px;height:12px}
