:root {
  --bg: #f5f3ef;
  --card: #ffffff;
  --ink: #161616;
  --muted: #77736c;
  --line: #e6e2db;
  --soft: #efece6;
  --accent: #1f1f1f;
  --on-accent: #ffffff;
  --ok: #2f7d4f;
  --bad: #b23b2e;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- controles ---------- */
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.btn, .primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 10px 18px; border: 1px solid var(--line);
  background: var(--card); font-weight: 550; text-decoration: none; white-space: nowrap;
  transition: transform .08s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { background: var(--soft); }
.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; padding: 13px 24px; font-size: 16px; }
.primary:hover { opacity: .92; }
.btn:active, .primary:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
.link:hover { color: var(--ink); }
.danger { color: var(--bad); }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 15px; color: var(--ink); font-weight: 400;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 1px; border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---------- barra superior ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px; padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 20px; }
.brand img { max-height: 32px; max-width: 160px; }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 550; }
.tabs button.active { background: var(--ink); color: #fff; }
.tabs button:not(.active):hover { background: var(--soft); color: var(--ink); }

main { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px; }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

/* ---------- login ---------- */
.login { max-width: 380px; margin: 10vh auto 0; text-align: center; }
.login form { text-align: left; margin-top: 24px; }
.login .primary { width: 100%; margin-top: 16px; }

/* ---------- enviar ---------- */
.send-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .send-grid { grid-template-columns: 1fr; } }

.drop {
  min-height: 420px; display: flex; flex-direction: column; border-style: dashed; border-width: 1.5px;
  transition: background .15s ease, border-color .15s ease;
}
.drop.over { background: color-mix(in srgb, var(--accent) 6%, #fff); border-color: var(--accent); }
.drop-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 20px; }
.drop-empty .big { font-family: var(--serif); font-size: 26px; line-height: 1.2; max-width: 14em; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.drop.has-files .drop-empty { flex: 0; padding: 0 0 12px; align-items: stretch; }
.drop.has-files .drop-empty .big, .drop.has-files .drop-empty .muted { display: none; }
.drop.has-files .drop-actions { justify-content: flex-start; margin: 0; }

.file-list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: 440px; border-top: 1px solid var(--line); }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.file-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .size { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.file-list .x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.file-list .x:hover { background: var(--soft); color: var(--ink); }
.ext { flex: none; width: 38px; height: 28px; border-radius: 6px; background: var(--soft); font-size: 10px; font-weight: 700; display: grid; place-items: center; color: var(--muted); text-transform: uppercase; overflow: hidden; }
.ext img { width: 100%; height: 100%; object-fit: cover; }
.drop-summary { display: flex; justify-content: space-between; padding-top: 12px; font-size: 13px; color: var(--muted); }

.chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: text;
}
.chips:focus-within { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 1px; }
.chips input { border: 0 !important; outline: none !important; flex: 1; min-width: 180px; padding: 4px 6px !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; color: var(--ink); font-weight: 500; }
.chip.bad { background: #f8e3df; color: var(--bad); }
.chip button { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.send-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.send-actions .primary { width: 100%; }

.progress { margin-top: 18px; }
.bar { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.progress-text { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }

.result { text-align: center; padding: 40px 24px; max-width: 640px; margin: 0 auto; }
.result .check-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; margin: 0 auto 16px; font-size: 26px; }
.copy-row { display: flex; gap: 8px; margin: 22px 0 10px; }
.copy-row input { flex: 1; font-size: 14px; }
.email-results { list-style: none; padding: 0; margin: 16px 0 0; text-align: left; font-size: 14px; }
.email-results li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.email-results .ok { color: var(--ok); }
.email-results .bad { color: var(--bad); }

/* ---------- tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .t-title { font-weight: 600; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions button, .table .actions a { margin-left: 6px; padding: 6px 12px; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 600; }
.pill.warn { background: #fbefd9; color: #8a5a00; }
.pill.good { background: #e1f1e7; color: var(--ok); }
.table-wrap { overflow-x: auto; padding: 4px 8px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }

/* ---------- ajustes ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }
.logo-box { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.logo-preview { width: 160px; height: 72px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; color: var(--muted); font-size: 12px; }
.logo-preview img { max-width: 90%; max-height: 80%; }
input[type=color] { width: 52px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.save-bar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 20px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; z-index: 100;
  transition: all .25s ease; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--bad); }

/* ====================== página de descarga ====================== */
.dl-header { display: flex; justify-content: center; padding: 34px 20px 10px; }
.dl-header img { max-height: 60px; max-width: 240px; }
.dl-header .studio { font-family: var(--serif); font-size: 24px; letter-spacing: .03em; }
.dl-main { max-width: 1180px; margin: 0 auto; padding: 20px clamp(14px, 4vw, 40px) 80px; }
.dl-hero { text-align: center; max-width: 720px; margin: 10px auto 36px; }
.dl-hero h1 { margin-bottom: 10px; }
.dl-meta { color: var(--muted); font-size: 14px; }
.dl-message { white-space: pre-line; margin: 22px auto 0; font-size: 16px; line-height: 1.7; color: #3a3833; text-align: left; max-width: 600px; }
.dl-actions { display: flex; justify-content: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }

.gallery { columns: 3 280px; column-gap: 12px; }
.gallery figure { margin: 0 0 12px; break-inside: avoid; position: relative; border-radius: 8px; overflow: hidden; background: var(--soft); cursor: zoom-in; }
.gallery img { display: block; width: 100%; height: auto; transition: transform .4s ease, opacity .4s ease; opacity: 0; }
.gallery img.loaded { opacity: 1; }
.gallery figure:hover img { transform: scale(1.02); }
.gallery .dl-one {
  position: absolute; right: 8px; bottom: 8px; opacity: 0; transition: opacity .2s ease;
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; text-decoration: none; color: #111;
}
.gallery figure:hover .dl-one, .gallery figure:focus-within .dl-one { opacity: 1; }
@media (hover: none) { .gallery .dl-one { opacity: 1; } }

.files-card { margin-top: 28px; padding: 8px 20px; }
.files-card h3 { padding: 14px 0 6px; }
.files-card ul { list-style: none; margin: 0; padding: 0; }
.files-card li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.files-card .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-card .size { color: var(--muted); font-size: 13px; }

.gate { max-width: 400px; margin: 6vh auto; text-align: center; }
.gate form { margin-top: 20px; text-align: left; }
.gate .primary { width: 100%; margin-top: 14px; }
.state { text-align: center; padding: 12vh 20px; }

.lightbox { position: fixed; inset: 0; background: rgba(12,12,12,.94); z-index: 50; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 4px; }
.lightbox .lb-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; color: #ddd; font-size: 14px; }
.lightbox .lb-bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox .lb-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 22px; }
.lightbox .lb-btn:hover { background: rgba(255,255,255,.2); }
.lightbox .prev { left: 16px; } .lightbox .next { right: 16px; }
.lightbox .close { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: #fff; font-size: 30px; }
.lightbox .btn { background: #fff; color: #111; border-color: transparent; }

.dl-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0; }
