/* TinyCompress v6.0 — Single Source of Truth */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --bg:#f8f9fa;
  --card:#ffffff;
  --fg:#09090b;
  --muted:#f4f4f5;
  --muted-fg:#71717a;
  --border:#e4e4e7;
  --border-h:#d1d5db;
  --primary:#18181b;
  --primary-fg:#ffffff;
  --blue:#2563eb;
  --blue-h:#1d4ed8;
  --blue-light:#eff6ff;
  --green:#16a34a;
  --green-bg:#f0fdf4;
  --green-border:#bbf7d0;
  --radius:8px;
  --radius-lg:12px;
  --shadow-xs:0 1px 2px rgba(0,0,0,.04);
  --shadow-sm:0 2px 6px rgba(0,0,0,.06);
  --shadow-md:0 4px 14px rgba(0,0,0,.08);
  --t:all 0.18s cubic-bezier(.4,0,.2,1);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

body {
  font-family:var(--font);
  background:var(--bg);
  color:var(--fg);
  min-height:100vh;
  display:flex;
  flex-direction:column;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ── Header ── */
.site-header {
  border-bottom:1px solid rgba(228,228,231,.7);
  background:rgba(255,255,255,.85);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  position:sticky;top:0;z-index:50;
}
.header-inner {
  max-width:960px;margin:0 auto;
  padding:.8rem 1.5rem;
  display:flex;justify-content:space-between;align-items:center;
}
.logo {
  display:flex;align-items:center;gap:.5rem;
  text-decoration:none;color:var(--fg);
  font-weight:700;font-size:1.1rem;letter-spacing:-.02em;
}
.logo-icon{width:22px;height:22px}
.logo-img{height:28px;max-width:120px;object-fit:contain;border-radius:4px}
.header-nav {
  display:flex;background:var(--muted);
  padding:.18rem;border-radius:6px;border:1px solid var(--border);
}
.lang-btn {
  text-decoration:none;color:var(--muted-fg);
  padding:.28rem .8rem;font-size:.78rem;font-weight:500;
  border-radius:4px;transition:var(--t);
}
.lang-btn.active,.lang-btn:hover {
  background:#fff;color:var(--fg);box-shadow:var(--shadow-xs);
}

/* ── Main ── */
.main-content {
  flex:1;max-width:680px;margin:2.5rem auto;
  padding:0 1rem;width:100%;
}
@media(min-width:640px){
  .main-content{margin:4rem auto;padding:0 1.5rem}
}

/* ── Hero ── */
.hero-section{text-align:center;margin-bottom:2rem}
.hero-title {
  font-size:2rem;font-weight:700;letter-spacing:-.04em;
  margin-bottom:.5rem;color:var(--fg);
}
@media(min-width:640px){.hero-title{font-size:2.5rem}}
.hero-subtitle{color:var(--muted-fg);font-size:.95rem;line-height:1.5}
.format-badges{display:flex;justify-content:center;gap:.35rem;margin-top:.75rem;flex-wrap:wrap}
.format-badge {
  font-size:.7rem;font-weight:500;color:var(--muted-fg);
  background:var(--muted);padding:.12rem .45rem;
  border-radius:4px;border:1px solid var(--border);
}

/* ── Format Selector ── */
.format-selector-wrap{display:flex;justify-content:center;margin-bottom:1.5rem;width:100%}
.format-selector {
  display:inline-flex;flex-direction:column;align-items:center;
  background:var(--muted);padding:.25rem;border-radius:var(--radius);
  border:1px solid var(--border);gap:.25rem;width:100%;max-width:450px;
}
.format-selector-label {
  font-size:.75rem;font-weight:600;color:var(--muted-fg);
  padding:.25rem .5rem;text-transform:uppercase;letter-spacing:.05em;
  border-bottom:1px solid var(--border);width:100%;text-align:center;
}
.format-options{display:grid;grid-template-columns:repeat(2,1fr);gap:.25rem;width:100%}
.format-option {
  font-size:.825rem;font-weight:500;color:var(--muted-fg);
  padding:.5rem;border-radius:6px;cursor:pointer;
  user-select:none;transition:var(--t);text-align:center;
}
@media(min-width:480px){
  .format-selector{flex-direction:row;width:auto;max-width:none;gap:.15rem}
  .format-selector-label{width:auto;border-bottom:none;border-right:1px solid var(--border);padding:0 .5rem 0 .25rem;margin-right:.25rem;text-transform:none;letter-spacing:normal;font-size:.8rem}
  .format-options{display:flex;gap:.15rem;width:auto}
  .format-option{padding:.35rem .85rem}
}
.format-option:hover{color:var(--fg)}
.format-option.selected{background:#fff;color:var(--fg);box-shadow:0 1px 2px rgba(0,0,0,.05);font-weight:600}

/* ── Drop Zone ── */
.drop-wrapper{margin-bottom:2rem}
.drop-zone {
  background:#fff;border:1.5px dashed var(--border);border-radius:var(--radius-lg);
  padding:2.5rem 1rem;text-align:center;cursor:pointer;
  transition:var(--t);outline:none;
}
@media(min-width:640px){.drop-zone{padding:3.5rem 2rem}}
.drop-zone:hover,.drop-zone:focus-within{
  border-color:#a1a1aa;background:#fafafa;
  box-shadow:0 4px 12px rgba(0,0,0,.03);
}
.drop-zone.drag-over{
  border-color:var(--blue);background:var(--blue-light);
  box-shadow:0 0 0 3px rgba(37,99,235,.08);
}
.drop-zone.shake{animation:shake .4s ease}
.upload-icon{width:28px;height:28px;margin-bottom:1rem;color:var(--muted-fg)}
.drop-text{font-size:.95rem;font-weight:500;color:var(--fg);margin-bottom:.15rem}
.drop-subtext{color:var(--muted-fg);font-size:.85rem}
@keyframes shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(4px)}}

/* Error Banner */
.error-banner {
  background:#fef2f2;border:1px solid #fee2e2;color:#ef4444;
  padding:.75rem;border-radius:var(--radius);margin-top:1rem;
  font-size:.85rem;font-weight:500;text-align:center;
}

/* Stats Bar */
.stats-bar{display:flex;flex-direction:column;gap:.5rem;padding:1rem .25rem;margin-top:.5rem;align-items:center;border-top:1px solid var(--muted)}
.stat-item{display:flex;align-items:center;gap:.4rem;justify-content:center;width:100%}
.stat-label{font-size:.825rem;color:var(--muted-fg)}
.stat-num{font-size:.85rem;font-weight:600;color:var(--fg)}
.stat-divider{display:none;color:var(--border)}
@media(min-width:480px){
  .stats-bar{flex-direction:row;justify-content:space-between;gap:0;border-top:none;padding:.75rem .25rem}
  .stat-item{width:auto}
  .stat-divider{display:block}
}

/* ── Results / Queue Area ── */
.results-area {
  background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1rem;
  margin-top:1.5rem;box-shadow:var(--shadow-sm);
}
@media(min-width:640px){.results-area{padding:1.25rem}}

.results-header {
  display:flex;justify-content:space-between;align-items:center;
  margin-bottom:1rem;padding-bottom:.85rem;
  border-bottom:1px solid var(--muted);gap:.5rem;
}
.results-title {
  display:flex;align-items:center;gap:.45rem;
  font-size:.72rem;font-weight:700;color:#9ca3af;
  text-transform:uppercase;letter-spacing:.08em;
}
.queue-count {
  font-size:.7rem;font-weight:600;color:#6b7280;
  background:#f3f4f6;border:1px solid #e5e7eb;
  padding:.08rem .42rem;border-radius:99px;
  text-transform:none;letter-spacing:0;
}
.files-list{display:flex;flex-direction:column;gap:.55rem}

/* ── File Item ── */
.file-item {
  display:flex;align-items:center;justify-content:space-between;
  padding:.85rem 1rem;gap:.9rem;
  border-radius:10px;border:1px solid #e2f5e2;
  background:linear-gradient(135deg,#fafffe 0%,#f5fef5 100%);
  transition:var(--t);position:relative;overflow:hidden;
}
.file-item::before {
  content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  background:linear-gradient(180deg,#34d399,#10b981);
  border-radius:3px 0 0 3px;
}
.file-item:hover{border-color:#6ee7b7;box-shadow:0 2px 10px rgba(16,185,129,.1)}

.file-item--loading{background:#fafafa;border-color:var(--border)}
.file-item--loading::before{
  background:linear-gradient(180deg,#93c5fd,#3b82f6);
  animation:pulse-bar 1.5s ease-in-out infinite;
}
@keyframes pulse-bar{0%,100%{opacity:.35}50%{opacity:1}}

.file-item--error{background:#fff5f5;border-color:#fecaca}
.file-item--error::before{background:linear-gradient(180deg,#fca5a5,#ef4444)}

.file-info-block{display:flex;align-items:center;gap:.8rem;min-width:0;flex:1}

/* Status icons */
.status-icon-success {
  width:26px;height:26px;flex-shrink:0;border-radius:50%;
  background:linear-gradient(135deg,#d1fae5,#a7f3d0);
  border:1.5px solid #6ee7b7;
  display:flex;align-items:center;justify-content:center;color:#059669;
}
.status-icon-error {
  width:26px;height:26px;flex-shrink:0;border-radius:50%;
  background:#fef2f2;border:1.5px solid #fecaca;
  display:flex;align-items:center;justify-content:center;color:#dc2626;
}
.status-icon-loading {
  width:26px;height:26px;flex-shrink:0;border-radius:50%;
  background:#eff6ff;border:1.5px solid #bfdbfe;
  display:flex;align-items:center;justify-content:center;
}

.file-details{display:flex;flex-direction:column;gap:.25rem;min-width:0}
.file-name {
  font-size:.875rem;font-weight:500;color:var(--fg);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.file-status{font-size:.78rem;color:var(--blue);font-weight:500}

/* Sizes & badges */
.file-sizes{display:flex;align-items:center;gap:.42rem;font-size:.78rem;color:var(--muted-fg);flex-wrap:wrap}
.size-from{text-decoration:line-through;opacity:.5}
.size-arrow{opacity:.4}
.file-sizes strong{color:var(--fg);font-weight:600}

.save-badge {
  display:inline-flex;align-items:center;gap:.18rem;
  font-size:.68rem;font-weight:700;padding:.09rem .38rem;border-radius:4px;
  color:#16a34a;background:#f0fdf4;border:1px solid #bbf7d0;
}
.save-badge--mid{color:#0284c7;background:#e0f2fe;border-color:#bae6fd}
.save-badge--great{color:#7c3aed;background:#ede9fe;border-color:#ddd6fe}
.save-badge--neutral{color:var(--muted-fg);background:var(--muted);border-color:var(--border)}

.convert-badge {
  font-size:.67rem;font-weight:600;color:#4f46e5;background:#eef2ff;
  padding:.08rem .36rem;border-radius:4px;border:1px solid #e0e7ff;
  text-transform:uppercase;letter-spacing:.03em;
}
.convert-badge.format-only{color:#0369a1;background:#f0f9ff;border-color:#bae6fd}
.error-badge{font-size:.775rem;color:#b91c1c;background:#fef2f2;padding:.09rem .38rem;border-radius:4px;border:1px solid #fecaca}

/* Progress */
.queue-progress-container{width:100%;margin-top:.3rem}
.progress-wrap{background:#e5e7eb;border-radius:99px;height:4px;overflow:hidden;width:100%}
.progress-bar{height:100%;background:linear-gradient(90deg,#3b82f6,#60a5fa);border-radius:99px;transition:width .25s ease;width:0}

.file-actions{flex-shrink:0}

/* ── Download Button ── */
.btn-download {
  display:inline-flex;align-items:center;gap:.42rem;
  font-size:.82rem;font-weight:600;color:#fff;text-decoration:none;
  background:linear-gradient(160deg,#2563eb 0%,#1d4ed8 100%);
  padding:.52rem 1.1rem;border-radius:8px;
  box-shadow:0 1px 3px rgba(37,99,235,.3),0 4px 12px rgba(37,99,235,.15),inset 0 1px 0 rgba(255,255,255,.1);
  transition:var(--t);white-space:nowrap;position:relative;overflow:hidden;
}
.btn-download::after{
  content:'';position:absolute;inset:0;
  background:linear-gradient(160deg,rgba(255,255,255,.12) 0%,transparent 60%);
  pointer-events:none;
}
.btn-download:hover{
  background:linear-gradient(160deg,#1d4ed8 0%,#1e40af 100%);
  box-shadow:0 2px 6px rgba(37,99,235,.4),0 8px 20px rgba(37,99,235,.2),inset 0 1px 0 rgba(255,255,255,.12);
  transform:translateY(-1px);
}
.btn-download:active{transform:translateY(0);box-shadow:0 1px 3px rgba(37,99,235,.25)}
.btn-download .dl-icon{transition:transform .18s ease}
.btn-download:hover .dl-icon{transform:translateY(2px)}

/* ── Buttons ── */
.btn {
  display:inline-flex;align-items:center;justify-content:center;gap:.35rem;
  border-radius:var(--radius);font-size:.82rem;font-weight:500;
  padding:.5rem .85rem;cursor:pointer;transition:var(--t);
  border:1px solid transparent;white-space:nowrap;
}
.btn-success{background:var(--primary);color:var(--primary-fg)}
.btn-success:hover{background:#27272a}
.btn-outline{background:#fff;border-color:var(--border);color:var(--fg)}
.btn-outline:hover{background:var(--muted);border-color:var(--border-h)}
.btn-sm{padding:.35rem .72rem;font-size:.78rem}
.btn-clear:hover{background:#fff1f2;border-color:#fca5a5;color:#dc2626}

/* Spinner */
.spinner {
  display:inline-block;width:14px;height:14px;
  border:2px solid #bfdbfe;border-top-color:#3b82f6;
  border-radius:50%;animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Mobile ── */
@media(max-width:520px){
  .file-item{flex-direction:column;align-items:flex-start;padding:.95rem 1rem;gap:.8rem}
  .file-info-block{width:100%}
  .file-actions{width:100%}
  .btn-download{width:100%;justify-content:center;padding:.6rem}
}

/* ── Footer ── */
.site-footer{border-top:1px solid var(--border);padding:2.5rem 1rem;margin-top:4rem;background:#fff}
.footer-inner{max-width:960px;margin:0 auto;display:flex;flex-direction:column;align-items:center;gap:1.25rem}
.footer-nav{display:flex;gap:1.25rem;flex-wrap:wrap;justify-content:center}
.footer-nav a{color:var(--muted-fg);text-decoration:none;font-size:.85rem;transition:var(--t)}
.footer-nav a:hover{color:var(--fg)}
.footer-copy{font-size:.78rem;color:var(--muted-fg);text-align:center}

.ad-slot{margin:1.5rem auto;display:flex;justify-content:center;max-width:100%;overflow:hidden}
.hidden{display:none!important}
