/* el Chayan · estilos. Un solo archivo, tokens arriba. */
:root {
  --bg: #F5F1EA;
  --surface: #FFFFFF;
  --surface-2: #EDE7DC;
  --ink: #1A1714;
  --ink-2: #3A342D;
  --muted: #72695E;
  --line: #E1D9CC;
  --accent: #9E4F28;          /* cobre de Santa Clara */
  --accent-soft: #F1E1D5;
  --on-accent: #FFFFFF;
  --ok: #2F6B4F;  --ok-soft: #DDEDE3;
  --warn: #946112; --warn-soft: #F5E8CF;
  --bad: #A23B32; --bad-soft: #F6DEDA;
  --info: #3B5A8A; --info-soft: #DFE6F2;
  --shadow: 0 1px 2px rgba(26, 23, 20, .05), 0 8px 24px rgba(26, 23, 20, .06);
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F0E0C; --surface: #181613; --surface-2: #23201C; --ink: #F0EAE0; --ink-2: #D6CFC4; --muted: #A1988B; --line: #2F2B26;
    --accent: #D9824F; --accent-soft: #3A2519; --on-accent: #160D07;
    --ok: #7CC4A0; --ok-soft: #1B2E24; --warn: #E2B25F; --warn-soft: #33281A; --bad: #EE8A80; --bad-soft: #3A1E1B; --info: #93B0E0; --info-soft: #1C2536;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F0E0C; --surface: #181613; --surface-2: #23201C; --ink: #F0EAE0; --ink-2: #D6CFC4; --muted: #A1988B; --line: #2F2B26;
  --accent: #D9824F; --accent-soft: #3A2519; --on-accent: #160D07;
  --ok: #7CC4A0; --ok-soft: #1B2E24; --warn: #E2B25F; --warn-soft: #33281A; --bad: #EE8A80; --bad-soft: #3A1E1B; --info: #93B0E0; --info-soft: #1C2536;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { margin: 0 0 .4em; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- header --- */
.top { position: sticky; top: 0; padding-top: env(safe-area-inset-top); z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; text-decoration: none; letter-spacing: -.02em; white-space: nowrap; }
.logo-el { font-style: italic; color: var(--accent); font-weight: 400; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; height: 42px; max-width: 560px; margin: 0 auto; transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.link-quiet { text-decoration: none; font-weight: 500; font-size: .94rem; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); }
.link-quiet:hover { background: var(--surface-2); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--muted); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }
.account-btn { text-decoration: none; font-weight: 600; font-size: .92rem; padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); white-space: nowrap; }
.rubros { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 10px; }
.rubros::-webkit-scrollbar { display: none; }
.rubros a { flex: none; text-decoration: none; font-size: .9rem; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); border: 1px solid transparent; }
.rubros a:hover { background: var(--surface-2); }
.rubros a.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .top-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 8px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .top-actions { margin-left: auto; }
  .account-btn { display: none; }
}

/* --- botones y formularios --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.sm { height: 36px; padding: 0 14px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.wa { background: #1F7A4D; border-color: #1F7A4D; color: #fff; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: .9rem; }
.field small { color: var(--muted); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.row2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--surface); font-size: .9rem; line-height: 1.3; }
.choice span b { display: block; }
.choice input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); }

/* --- home --- */
.hero { display: grid; gap: 32px; padding-block: 48px 32px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; padding-block: 72px 56px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.hero-lead { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }
.trust { display: flex; flex-wrap: wrap; gap: 26px; }
.trust div b { display: block; font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.trust div span { font-size: .85rem; color: var(--muted); }
.collage { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 1 / .95; }
.collage a { border-radius: var(--radius); overflow: hidden; position: relative; background: var(--surface-2); }
.collage a:first-child { grid-row: span 2; }
.collage img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.collage a:hover img { transform: scale(1.04); }
.collage .tag { position: absolute; left: 10px; bottom: 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: 6px 10px; border-radius: 8px; font-size: .78rem; line-height: 1.25; }
.collage .tag b { display: block; font-size: .86rem; }

.section { padding-block: 36px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; font-size: .92rem; white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat { text-decoration: none; display: grid; gap: 8px; }
.cat-img { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.cat-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.cat:hover img { transform: scale(1.05); }
.cat b { font-weight: 600; }
.cat small { color: var(--muted); display: block; font-size: .8rem; margin-top: -4px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 30px 20px; } }
.card { text-decoration: none; display: grid; gap: 4px; align-content: start; }
.card-img { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); margin-bottom: 8px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.04); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 4px 8px; border-radius: 6px; background: var(--surface); color: var(--ink); }
.card-img .badge { position: absolute; top: 10px; left: 10px; }
.card-img .badge.ok { left: auto; right: 10px; background: color-mix(in srgb, var(--surface) 90%, transparent); }
.sold-veil { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); display: grid; place-items: center; }
.sold-veil span { font-family: var(--serif); font-style: italic; font-size: 1.4rem; background: var(--bg); padding: 4px 14px; border-radius: 999px; }
.brand { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card-title { font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; font-size: 1.06rem; font-variant-numeric: tabular-nums; }
.price s { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }
.save { color: var(--ok); font-size: .82rem; font-weight: 600; }

.steps { display: grid; gap: 14px; counter-reset: s; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; counter-increment: s; }
.step::before { content: counter(s, decimal-leading-zero); font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 1.5rem; display: block; margin-bottom: 10px; }
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

.guarantee { background: var(--ink); color: var(--bg); border-radius: 22px; padding: 36px 24px; display: grid; gap: 28px; }
@media (min-width: 900px) { .guarantee { grid-template-columns: 1fr 1.4fr; padding: 52px; } }
.guarantee h2 em { color: var(--accent); font-style: italic; }
.guarantee .g-list { display: grid; gap: 18px; }
@media (min-width: 640px) { .guarantee .g-list { grid-template-columns: 1fr 1fr; } }
.guarantee .g-list div { border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent); padding-top: 14px; }
.guarantee .g-list b { display: block; margin-bottom: 4px; }
.guarantee .g-list p { opacity: .72; font-size: .94rem; margin: 0; }

.strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; }
.strip > * { scroll-snap-align: start; flex: none; width: 200px; }
.sold-item { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; width: 270px; }
.sold-item img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.sold-item div { font-size: .84rem; line-height: 1.3; min-width: 0; }
.sold-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.ctas { display: grid; gap: 14px; }
@media (min-width: 800px) { .ctas { grid-template-columns: 1fr 1fr; } }
.cta-card { border-radius: 22px; padding: 30px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.cta-card.warm { background: var(--accent-soft); border-color: transparent; }
.cta-card p { color: var(--ink-2); }
.cta-card .btn { justify-self: start; margin-top: 8px; }

/* --- listado --- */
.page-head { padding-block: 32px 8px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.list-layout { display: grid; gap: 24px; padding-bottom: 48px; }
@media (min-width: 900px) { .list-layout { grid-template-columns: 230px 1fr; gap: 36px; } }
.filters { display: grid; gap: 22px; align-content: start; }
.filters .fgroup { display: grid; gap: 8px; }
.filters label.chk { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.filters input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
@media (max-width: 899px) { .filters { display: none; } .filters.open { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; } }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.list-bar select { width: auto; padding: 8px 12px; }
.filter-toggle { display: none; }
@media (max-width: 899px) { .filter-toggle { display: inline-flex; } }
.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* --- producto --- */
.pd { display: grid; gap: 28px; padding-block: 28px 40px; }
@media (min-width: 900px) { .pd { grid-template-columns: 1.1fr 1fr; gap: 52px; } }
.pd-img { border-radius: 20px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; position: relative; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .pd-img { position: sticky; top: 130px; } }
.pd-info h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.pd-price { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 10px 0 2px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.chip { font-size: .82rem; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.chip.grade { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.pd-actions { display: grid; gap: 10px; margin: 22px 0; }
@media (min-width: 520px) { .pd-actions { grid-template-columns: 1fr 1fr; } .pd-actions .btn:first-child { grid-column: span 2; } }
.box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); margin-bottom: 14px; }
.box h3 { font-size: 1.05rem; margin-bottom: 10px; font-family: var(--sans); font-weight: 600; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; font-size: .94rem; }
.checks li svg { color: var(--ok); margin-top: 2px; width: 18px; height: 18px; }
.seller-line { display: flex; align-items: center; gap: 12px; font-size: .92rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--serif); font-size: 1.1rem; flex: none; }

/* --- formularios de página --- */
.form-layout { display: grid; gap: 28px; padding-block: 28px 56px; }
@media (min-width: 900px) { .form-layout { grid-template-columns: 1.3fr 1fr; gap: 52px; } }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
@media (min-width: 640px) { .panel-card { padding: 32px; } }
.panel-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: 6px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.panel-card h3:first-child { border-top: 0; padding-top: 0; }
.side-steps { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 16px; }
.side-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; }
.side-steps li span { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--serif); font-style: italic; }
.side-steps li p { margin: 0; color: var(--muted); font-size: .93rem; }
.side-steps li b { color: var(--ink); display: block; }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photos .ph { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); cursor: pointer; position: relative; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; line-height: 1; }
.success { text-align: center; padding: 36px 10px; }
.success .big { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.success .big svg { width: 30px; height: 30px; stroke-width: 2.2; }

/* --- cuenta y panel --- */
.login { max-width: 420px; margin: 48px auto 64px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 28px 18px; }
.dash-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0; }
/* pestañas: control segmentado, sin márgenes negativos (eso causaba el desborde raro) */
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--surface-2); border-radius: 999px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; width: fit-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06); }
.tabs .count { background: var(--accent); color: var(--on-accent); font-size: .7rem; line-height: 1; padding: 4px 7px; border-radius: 999px; }
@media (max-width: 560px) { .tabs { width: auto; border-radius: 16px; } .tabs button { padding: 9px 12px; font-size: .88rem; } }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.kpi span { font-size: .82rem; color: var(--muted); display: block; }
.kpi b { font-family: var(--serif); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2rem); display: block; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .8rem; color: var(--ok); font-weight: 600; }
.kpi small.down { color: var(--bad); }
.dash-grid { display: grid; gap: 14px; margin-bottom: 22px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1.4fr 1fr; } }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.chart-card h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.chart-card .muted { font-size: .85rem; }
.bars { display: flex; align-items: end; gap: 10px; height: 200px; margin-top: 16px; }
.bars .b { flex: 1; display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; gap: 6px; }
.bars .b i { display: block; align-self: end; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.bars .b.cur i { opacity: 1; }
.bars .b small { font-size: .74rem; color: var(--muted); }
.bars .b em { font-style: normal; font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 10px; margin-top: 14px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: .85rem; }
.hbar div { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar div i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t-item { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.t-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.t-item b { font-weight: 600; display: block; line-height: 1.25; }
.t-item small { color: var(--muted); }
.status { display: inline-block; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--bad-soft); color: var(--bad); }
.status.info { background: var(--info-soft); color: var(--info); }
.status.accent { background: var(--accent-soft); color: var(--accent); }
select.st { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; font-size: .84rem; }
.lead-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .lead-list { grid-template-columns: 1fr 1fr; } }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.lead-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.lead q { font-style: italic; color: var(--ink-2); }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feed { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.feed li { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: baseline; font-size: .9rem; }
.feed li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.feed li small { color: var(--muted); white-space: nowrap; }
.timeline { display: flex; gap: 4px; margin: 10px 0 4px; }
.timeline i { flex: 1; height: 4px; border-radius: 9px; background: var(--surface-2); }
.timeline i.on { background: var(--accent); }
.purchase { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: 76px 1fr; gap: 14px; margin-bottom: 12px; }
.purchase img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar .input { width: auto; flex: 1; min-width: 180px; padding: 9px 12px; }

/* --- modal, toast, barra inferior --- */
.modal { border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(10, 8, 6, .55); backdrop-filter: blur(3px); }
.modal-in { padding: 26px; }
.modal-x { float: right; margin: -8px -8px 0 0; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { .toast { bottom: 28px; } }
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: .7rem; text-decoration: none; color: var(--muted); padding: 4px 0; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
}
.foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 40px 0 24px; }
.foot-in { display: grid; gap: 24px; }
@media (min-width: 800px) { .foot-in { grid-template-columns: 1.3fr 1fr 1fr; } }
.foot p { font-size: .92rem; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-legal { font-size: .8rem; padding-top: 18px; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
main:focus { outline: none; }
td:first-child { white-space: nowrap; }
.push-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.push-box b { display: inline-flex; align-items: center; gap: 8px; }
.push-box p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-2); }
.push-box svg { width: 18px; height: 18px; color: var(--accent); }
.push-actions { display: flex; gap: 8px; }
/* compartir */
.share-link { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; margin: -8px 0 18px; color: var(--ink-2); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.share-link svg { width: 18px; height: 18px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.share-opt { display: grid; justify-items: start; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; font-weight: 600; cursor: pointer; text-align: left; }
.share-opt:hover { border-color: var(--ink); }
.share-opt[disabled] { opacity: .6; cursor: progress; }
.share-opt small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.share-opt > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); margin-bottom: 6px; }
.share-opt .wa-dot { background: #1F7A4D; color: #fff; }
.share-opt .ig-dot { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); color: #fff; }
.ig-prev { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.ig-prev img { height: 150px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; flex: none; background: var(--surface-2); }
.chk-col { width: 44px; padding-right: 0; }
.chk-col input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
tr.picked td { background: var(--accent-soft); }
.pick-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 45; display: flex; align-items: center; gap: 16px; background: var(--ink); color: var(--bg); padding: 10px 10px 10px 20px; border-radius: 999px; box-shadow: var(--shadow); max-width: calc(100vw - 24px); }
.pick-bar[hidden] { display: none; }
.pick-bar .btn.ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.pick-actions { display: flex; gap: 6px; }
@media (max-width: 760px) { .pick-bar { bottom: calc(76px + env(safe-area-inset-bottom)); gap: 10px; padding-left: 14px; } .pick-bar b { font-size: .85rem; } .pick-bar #pickclear { display: none; } }
/* menú de estado */
.st-menu { display: inline-block; flex: none; }
.st-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; padding: 4px 6px 4px 10px; }
.st-btn svg { width: 14px; height: 14px; stroke-width: 2.4; opacity: .75; transition: transform .15s; }
.st-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.st-btn:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px var(--line); }
.st-pop { position: absolute; z-index: 70; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; display: grid; animation: fade .15s ease both; }
.st-pop small { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 10px 4px; }
.st-pop button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: .9rem; color: var(--ink); }
.st-pop button:hover, .st-pop button:focus-visible { background: var(--surface-2); outline: none; }
.st-pop button[aria-checked="true"] { font-weight: 700; }
.st-pop button svg { margin-left: auto; width: 16px; height: 16px; color: var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.info { background: var(--info); } .dot.accent { background: var(--accent); }
.hbar { grid-template-columns: 110px 1fr 84px; }
.bars .b em { font-size: .66rem; }

/* contraseña con ojito */
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--ink); background: var(--surface-2); }

/* tarjetas de operación con línea de tiempo */
.deal-list { display: grid; gap: 14px; }
@media (min-width: 900px) { .deal-list.two { grid-template-columns: 1fr 1fr; align-items: start; } }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.deal-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deal-head img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.deal-head > div { flex: 1; min-width: 0; }
.deal-head b { display: block; font-weight: 600; line-height: 1.3; }
.deal-head small { color: var(--muted); font-size: .82rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-head > .status, .deal-head > .st-menu { flex: none; }
.deal-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.deal-amount span { font-size: .84rem; color: var(--muted); }
.deal-amount b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.deal-amount a { margin-left: auto; font-size: .85rem; font-weight: 600; }
.deal q { font-style: italic; color: var(--ink-2); }
.deal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.turn { justify-self: start; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.turn.me { background: var(--accent); color: var(--on-accent); }
.sub-h { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 22px 0 10px; }
.ok-t { color: var(--ok); }

.tl { list-style: none; margin: 0; padding: 0; display: grid; }
.tl li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 14px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: -2px; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); margin-top: 3px; box-shadow: 0 0 0 3px var(--surface); position: relative; z-index: 1; }
.tl-dot.info { background: var(--info); } .tl-dot.accent { background: var(--accent); } .tl-dot.ok { background: var(--ok); }
.tl li > div { display: grid; gap: 2px; min-width: 0; font-size: .92rem; line-height: 1.4; }
.tl li q { font-size: .88rem; color: var(--ink-2); }
.tl li small { color: var(--muted); font-size: .76rem; }
.tl-wait .tl-dot { background: var(--surface); border: 2px dashed var(--muted); box-shadow: 0 0 0 3px var(--surface); }
.tl-wait span { color: var(--muted); font-style: italic; }
.tl.compact li { padding-bottom: 10px; }
.tl.compact li > div { font-size: .86rem; }
.tl-legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); }
.tl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.todo { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.todo button { width: 100%; display: flex; justify-content: space-between; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-size: .88rem; }
.todo button:hover { border-color: var(--accent); }
.todo em { font-style: normal; color: var(--accent); font-weight: 600; white-space: nowrap; font-size: .82rem; }
.deal-head { flex-wrap: wrap; row-gap: 8px; }
.deal-head > div { flex: 1 1 170px; }
