:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1b1d21;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #e0392f;
  --accent-dark: #bf2b23;
  --accent-soft: #fdecea;
  --ok: #16794f;
  --ok-soft: #e6f5ee;
  --warn: #9a6100;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 20, 30, .06), 0 8px 24px rgba(16, 20, 30, .07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1c1f25;
    --text: #e8eaed;
    --muted: #9aa1ac;
    --line: #2c313a;
    --accent: #f0574c;
    --accent-dark: #d43e33;
    --accent-soft: #3a201e;
    --ok: #5ad1a0;
    --ok-soft: #172c25;
    --warn: #f0b95c;
    --warn-soft: #2f2718;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main { max-width: 720px; margin: 0 auto; }

/* ---------------------------------------------------------------- cabecera */
.top { max-width: 720px; margin: 0 auto; padding: 40px 0 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 14px; letter-spacing: .5px;
  flex: 0 0 auto;
}
.top h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ tarjeta */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.step + .step { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.step h2 {
  margin: 0 0 14px;
  font-size: 15px; font-weight: 650;
  display: flex; align-items: center; gap: 9px;
}
.step h2 .n {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700;
}

/* ------------------------------------------------------------------- drop */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 34px 20px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-size: 15px; }
.drop span { color: var(--muted); font-size: 13px; }

.ico { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 17px; height: 17px; }

.fileinfo {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg);
}
.fileinfo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileinfo b { margin-left: auto; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* ------------------------------------------------------------------ modos */
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 10px; }
.mode {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 11px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode .t { font-weight: 600; font-size: 14px; }
.mode .d { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mode:hover { border-color: var(--muted); }
.mode:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --------------------------------------------------------------- opciones */
.opt[hidden], .check[hidden] { display: none; }
.opt { margin-bottom: 14px; }
.lbl { display: block; margin-bottom: 6px; font-size: 13.5px; color: var(--muted); }

input[type=number] {
  width: 130px; padding: 10px 12px;
  font: inherit; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 9px;
}
input[type=number]:focus { border-color: var(--accent); outline: none; }

.sizerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.units { display: inline-flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.units label { position: relative; }
.units input { position: absolute; opacity: 0; pointer-events: none; }
.units span {
  display: block; padding: 10px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.units label:has(input:checked) span { background: var(--accent); color: #fff; }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }

/* ------------------------------------------------------------------ boton */
.go {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 24px; padding: 15px;
  font: inherit; font-size: 16px; font-weight: 650;
  color: #fff; background: var(--accent);
  border: 0; border-radius: 11px; cursor: pointer;
  transition: background .15s;
}
.go .ico { stroke: #fff; }
.go:hover:not(:disabled) { background: var(--accent-dark); }
.go:disabled { opacity: .45; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: #fff; background: var(--accent); border-radius: 9px;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { color: var(--accent); background: transparent; border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

.link {
  padding: 0; margin-top: 4px;
  font: inherit; font-size: 13.5px;
  color: var(--muted); background: none; border: 0;
  cursor: pointer; text-decoration: underline;
}
.link:hover { color: var(--accent); }

/* --------------------------------------------------------------- progreso */
.progress .bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.progress p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ error */
.err { border-color: var(--accent); background: var(--accent-soft); }
.err p { margin: 6px 0 0; font-size: 14px; }

/* -------------------------------------------------------------- resultado */
.reshead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.reshead h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.files { list-style: none; margin: 18px 0 0; padding: 0; }
.files li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.files .fname { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .meta { color: var(--muted); font-size: 12.5px; }
.files .grow { min-width: 0; flex: 1; }
.files .size {
  font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px;
  color: var(--ok); background: var(--ok-soft); white-space: nowrap;
}
.files .size.over { color: var(--warn); background: var(--warn-soft); }
.files a.dl { color: var(--accent); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.files a.dl:hover { text-decoration: underline; }

.notes { list-style: none; margin: 16px 0 0; padding: 0; }
.notes li {
  padding: 9px 12px; margin-top: 8px;
  font-size: 13px; color: var(--warn);
  background: var(--warn-soft); border-radius: 8px;
}

/* ------------------------------------------------------------------- pie */
.foot { margin-top: 26px; color: var(--muted); font-size: 12.5px; text-align: center; }
.foot p { margin: 4px 0; }

@media (max-width: 560px) {
  .top { padding: 26px 0 18px; }
  .card { padding: 18px; }
  .modes { grid-template-columns: 1fr 1fr; }
  .files li { flex-wrap: wrap; }
}
