:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --text: #16211f;
  --muted: #5b6b68;
  --line: #dbe3e1;
  --brand: #0f766e;
  --brand-dark: #0b5a54;
  --brand-soft: #e3f3f1;
  --error: #b42318;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1615;
    --surface: #17211f;
    --text: #e8efed;
    --muted: #9fb0ac;
    --line: #2a3835;
    --brand: #2bb3a6;
    --brand-dark: #229488;
    --brand-soft: #18302d;
    --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--brand); }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--brand); }

.hero { padding-top: 24px; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0 0 18px; }

/* Selector de herramientas */
.tool-groups { display: grid; gap: 14px; margin-bottom: 14px; }
.group-title { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tool-btn {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tool-btn:hover { border-color: var(--brand); }
.tool-btn.is-active { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tool-btn:disabled { opacity: .5; cursor: not-allowed; }
.ti { font-size: 1.35rem; line-height: 1; }
.tool-btn strong { display: block; font-size: .92rem; line-height: 1.25; }
.tool-btn small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-title { margin: 0 0 2px; font-size: 1.15rem; }
.card-desc { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop-icon { font-size: 1.8rem; }
.drop-title { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: .9rem; }

.file-info { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.file-info video { width: 220px; max-width: 100%; max-height: 150px; background: #000; border-radius: 10px; }
.file-info video.is-audio { height: 54px; background: transparent; }
.file-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-meta strong { word-break: break-all; }
.file-meta span { color: var(--muted); font-size: .92rem; }

.options { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.options label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; flex: 1 1 180px; max-width: 320px; }
select, input[type="text"] {
  font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); width: 100%;
}
select:focus, input[type="text"]:focus, .tool-btn:focus-visible, .btn-primary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .92rem; margin: 8px 0 0; }

.btn-primary {
  display: block; width: 100%; margin-top: 18px; padding: 14px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--brand); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; align-self: flex-start; }

.status { margin-top: 16px; }
.status p { margin: 0 0 8px; font-weight: 600; }
.bar { height: 10px; background: var(--brand-soft); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.bar-fill { height: 100%; width: 0; background: var(--brand); transition: width .2s; }

.results { margin-top: 16px; display: grid; gap: 10px; }
.result {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-soft);
}
.result span { min-width: 0; word-break: break-word; }
.result a {
  background: var(--brand); color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-weight: 700;
}
.result img { display: block; max-width: 100%; max-height: 220px; border-radius: 8px; flex-basis: 100%; object-fit: contain; }
.error { color: var(--error); font-weight: 600; margin: 14px 0 0; }

.trust { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; color: var(--muted); font-size: .9rem; }

.ad-slot { margin: 24px 0; min-height: 0; }

.content { padding-bottom: 32px; }
.content h2 { font-size: 1.3rem; margin: 28px 0 8px; }
details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px 14px; margin-bottom: 8px; }
summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; color: var(--muted); }

.page { padding: 24px 16px 40px; }
.page h2 { font-size: 1.2rem; margin-top: 24px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; color: var(--muted); font-size: .9rem; }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.site-footer p { margin: 0; }

@media (max-width: 520px) {
  .tools { grid-template-columns: 1fr 1fr; gap: 6px; }
  .tool-btn { padding: 8px; gap: 6px; }
  .ti { font-size: 1.1rem; }
  .tool-btn strong { font-size: .82rem; }
  .tool-btn small { font-size: .72rem; }
  .card { padding: 14px; }
  .file-info video { width: 100%; max-height: 200px; }
  .options label { max-width: none; }
}
