:root {
  --bg: #f6f7fb; --card: #fff; --ink: #1b1f2a; --muted: #6b7280; --line: #e5e7ef;
  --accent: #4f46e5; --accent-ink: #fff; --accent-soft: #eef2ff; --ok: #059669; --warn: #d97706; --bad: #dc2626;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
header.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }
.hero { padding: 40px 0 20px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0; max-width: 640px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 60px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(16,24,40,.12); }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #eceef5; border-bottom: 1px solid var(--line); }
.thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; transform: scale(var(--s, .25)); pointer-events: none; background: #fff; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin: 0; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.price { font-weight: 700; }
.tag { font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #c7cbe0; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: wait; }
/* Vista del mockup */
.viewer-bar { background: var(--card); border-bottom: 1px solid var(--line); }
.viewer-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 12px; padding-bottom: 12px; }
.viewer-bar h1 { margin: 0; font-size: 18px; }
.viewer-bar .sub { color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.stage { padding: 20px; display: flex; justify-content: center; min-height: calc(100vh - 140px); }
.frame { width: 100%; height: calc(100vh - 180px); min-height: 480px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); transition: width .25s; }
.frame.tablet { width: 768px; height: min(1024px, calc(100vh - 180px)); border-radius: 22px; border: 10px solid #1f2330; }
.frame.mobile { width: 390px; height: min(844px, calc(100vh - 180px)); border-radius: 30px; border: 10px solid #1f2330; }
.desc { max-width: 900px; margin: 0 auto; padding: 0 20px 40px; color: var(--muted); white-space: pre-line; }
/* Diálogos y formularios */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(15,18,30,.55); }
dialog .dhead { padding: 18px 22px 0; display: flex; align-items: start; gap: 12px; }
dialog .dhead h2 { margin: 0; font-size: 19px; flex: 1; }
dialog .dbody { padding: 14px 22px 22px; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
label.f { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
label.f small { display: block; font-weight: 400; color: var(--muted); }
input, textarea, select { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); margin-top: 4px; font-weight: 400; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.cb { width: auto; margin: 0 6px 0 0; vertical-align: -2px; }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.err { color: var(--bad); font-size: 14px; margin: 6px 0 10px; }
.okbox { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.note { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
/* Panel */
.login { max-width: 360px; margin: 12vh auto; background: var(--card); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.login h1 { margin: 0 0 16px; font-size: 22px; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; font: inherit; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.panel { padding-top: 24px; padding-bottom: 60px; }
.panel h2 { margin: 0 0 14px; font-size: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar select, .toolbar input { width: auto; margin: 0; }
.list { display: flex; flex-direction: column; gap: 12px; }
.item { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; align-items: center; }
.item .thumb { border-radius: 8px; border: 1px solid var(--line); }
.item h3 { margin: 0 0 2px; font-size: 16px; }
.item .line { color: var(--muted); font-size: 13px; }
.item .btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 280px; }
.badge { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #f1f2f6; color: var(--muted); font-weight: 600; }
.badge.hidden-b { background: #fef3c7; color: #92400e; }
.st-nuevo { background: #dbeafe; color: #1e40af; }
.st-pagado { background: #dcfce7; color: #166534; }
.st-dominio_comprado { background: #ede9fe; color: #5b21b6; }
.st-entregado { background: #e5e7eb; color: #111827; }
.st-cancelado { background: #fee2e2; color: #991b1b; }
.order { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; }
.order .ohead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.order .ohead strong { font-size: 16px; }
.order dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 12px; font-size: 14px; }
.order dt { color: var(--muted); }
.order dd { margin: 0; word-break: break-word; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.steps button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.steps button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.steps button.past { border-color: #c7d2fe; color: var(--accent); }
.hist { font-size: 12px; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2330; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 100; }
.copy-in { display: flex; gap: 6px; }
.copy-in input { margin: 0; }
@media (max-width: 760px) {
  .item { grid-template-columns: 1fr; }
  .item .btns { justify-content: flex-start; max-width: none; }
  .row { flex-direction: column; gap: 0; }
  .frame.tablet, .frame.mobile { border-width: 6px; }
}
