:root {
  --bg:#09150f; --surface:#11241a; --soft:#1a3426; --ink:#edf7f0; --muted:#9eb6a7; --ghost:#6f8c7b; --line:#2a4a39;
  --accent:#9bc7a4; --on-accent:#102018; --danger:#f0a1a1; --ok:#2f6b47; --bad:#7a2f35;
  color-scheme:dark; font:16px/1.45 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; -webkit-text-size-adjust:100%;
}
* { box-sizing:border-box; }
html,body { margin:0; background:var(--bg); color:var(--ink); overscroll-behavior-y:none; }
button,input,select { font:inherit; color:inherit; }
button { cursor:pointer; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:default; opacity:.45; }
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
[hidden] { display:none!important; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

.app { max-width:640px; margin:auto; padding:calc(12px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom)); min-height:100dvh; display:flex; flex-direction:column; }
#add-panel,#list-panel { flex:1; }

.tabs { display:flex; gap:10px; margin-bottom:14px; }
.tabs button { flex:1; min-width:0; border:0; border-radius:15px; padding:12px 14px; min-height:54px; background:var(--soft); color:var(--muted); font-size:17px; font-weight:750; }
.tabs button[aria-selected="true"] { background:var(--accent); color:var(--on-accent); }
.count { font-size:12px; padding:2px 7px; border-radius:30px; background:color-mix(in srgb,currentColor 13%,transparent); margin-left:4px; }

/* Anotar */
.entry-wrap { min-height:170px; border-radius:22px; background:var(--surface); padding:18px; margin-bottom:12px; display:flex; flex-direction:column; justify-content:center; gap:14px; box-shadow:0 5px 24px #00000024; }
.entry-wrap:focus-within { box-shadow:0 5px 24px #00000024, inset 0 0 0 1px var(--accent); }
.entry-field { position:relative; }
#entry, .entry-mirror, .entry-mirror span { font-size:clamp(32px,9vw,46px); line-height:1.2; font-weight:780; letter-spacing:-.035em; text-align:center; padding:14px 4px; }
#entry { position:relative; z-index:1; width:100%; border:0; background:transparent; outline:none; caret-color:var(--accent); }
#entry::placeholder { color:#5e7d6b; opacity:1; }
#entry.is-link { font-size:17px; font-weight:500; letter-spacing:0; text-align:left; color:var(--muted); padding:6px 4px; }
.entry-mirror { position:absolute; inset:0; white-space:pre; overflow:hidden; pointer-events:none; text-align:left; }
.entry-mirror .typed { position:absolute; visibility:hidden; white-space:pre; }
.entry-mirror .ghost { position:absolute; color:var(--ghost); white-space:pre; }
.entry-mirror:not(.active) .ghost { display:none; }
.entry-mirror span { padding:0; }
.entry-preview { display:flex; gap:12px; align-items:center; text-align:left; }
.entry-preview .thumb { width:64px; height:64px; border-radius:12px; flex-shrink:0; background:var(--soft) center/cover no-repeat; }
.entry-preview .info { min-width:0; display:flex; flex-direction:column; gap:2px; }
.entry-preview .title { font-weight:700; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.entry-preview .sub { font-size:13px; color:var(--muted); }

.category-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.category-grid.compact { gap:10px; }
.category-button { border:0; border-radius:16px; min-height:70px; padding:14px 12px; display:flex; gap:10px; align-items:center; justify-content:center; background:color-mix(in srgb,var(--cat) 14%,var(--soft)); font-size:16px; font-weight:700; transition:transform .08s ease, background .14s ease, box-shadow .14s ease; }
.compact .category-button { min-height:58px; }
.category-button.predicted { box-shadow:inset 0 0 0 2px var(--accent); }
.category-button:active:not(:disabled) { transform:scale(.975); }
.category-icon { font-size:26px; line-height:1; font-weight:500; }
.category-name { overflow-wrap:anywhere; min-width:0; }

/* Filtros */
.filter-row { display:flex; gap:8px; overflow-x:auto; margin:0 -14px 14px; padding:1px 14px 6px; scrollbar-width:none; overscroll-behavior-inline:contain; }
.filter-row::-webkit-scrollbar { display:none; }
.chip { flex:0 0 auto; white-space:nowrap; border:1px solid var(--line); border-radius:999px; background:var(--surface); min-height:42px; padding:8px 14px; font-size:14px; font-weight:720; user-select:none; -webkit-user-select:none; }
.chip[aria-pressed="true"] { color:var(--on-accent); background:var(--accent); border-color:var(--accent); }

/* Lista */
.group { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:12px 16px 4px; margin-bottom:12px; }
.group-head { display:flex; align-items:center; gap:8px; min-height:40px; touch-action:pan-y; user-select:none; -webkit-user-select:none; }
.group-head h2 { margin:0; font-size:17px; font-weight:780; overflow-wrap:anywhere; }
.group-head .n { font-size:12px; color:var(--muted); }
.clear-button { margin-left:auto; border:0; background:transparent; color:var(--muted); font-size:13px; font-weight:600; min-height:40px; padding:0 2px; }
.rows { position:relative; }
.row-wrap { position:relative; border-bottom:1px solid var(--line); }
.row-wrap.child { border-bottom:0; }
.row-wrap.last-child { border-bottom:1px solid var(--line); }
.rows > .item-block:last-child > .row-wrap { border-bottom:0; }
.rows > .item-block:last-child .row-wrap.last-child { border-bottom:0; }
.item-block { position:relative; background:var(--surface); }
.swipe-bg { position:absolute; inset:2px 0; border-radius:12px; display:flex; align-items:center; padding:0 18px; font-size:14px; font-weight:750; opacity:0; }
.swipe-bg.right { background:var(--ok); justify-content:flex-start; }
.swipe-bg.left { background:var(--bad); justify-content:flex-end; }
.row { position:relative; display:flex; align-items:center; gap:8px; min-height:56px; background:var(--surface); touch-action:pan-y; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.child .row { min-height:44px; padding-left:34px; }
.row.lifted { z-index:5; box-shadow:0 10px 28px #0007; border-radius:12px; background:var(--soft); }
.row.settling { transition:transform .18s ease; }
.shift { transition:transform .15s ease; }
.chip.lifted { box-shadow:0 6px 18px #0008; outline:2px solid var(--accent); outline-offset:1px; }
.check.fit { flex:0 0 auto; min-width:23px; }
.item-link { flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:1px; border:0; background:transparent; padding:8px 0; text-align:left; font-size:16px; color:var(--ink); }
.item-link .item-site { display:inline-flex; align-items:center; gap:4px; color:var(--accent); }
.item-link .item-site svg { width:12px; height:12px; }
.done .item-link .item-site { color:var(--muted); }
.check { display:flex; align-items:center; gap:13px; flex:1; min-width:0; min-height:44px; }
.check input { width:23px; height:23px; flex-shrink:0; margin:0; accent-color:var(--accent); }
.child .check input { width:19px; height:19px; }
.item-text { overflow-wrap:anywhere; }
.child .item-text { font-size:15px; }
.done .item-text { text-decoration:line-through; color:var(--muted); }
.item-site { display:block; font-size:12px; color:var(--muted); }
.progress { font-size:12px; color:var(--muted); padding:3px 8px; border-radius:20px; background:var(--soft); }
.small-button { width:40px; height:40px; flex-shrink:0; border:0; border-radius:12px; background:transparent; color:var(--muted); display:grid; place-items:center; }
.small-button svg { transition:transform .15s ease; }
.expanded .small-button.toggle svg { transform:rotate(180deg); }
.collapsed-link { display:flex; align-items:center; gap:8px; width:100%; min-height:48px; border:0; border-bottom:1px solid var(--soft); background:transparent; color:var(--muted); font-size:15px; font-weight:650; padding:0 4px; text-align:left; }
.collapsed-link:last-child { border-bottom:0; }
.collapsed-link svg { margin-left:auto; }
.empty { color:var(--muted); text-align:center; padding:40px 10px; }
.section-title { display:flex; align-items:baseline; gap:8px; margin:4px 2px 10px; font-size:17px; font-weight:780; }
.section-title .n { font-size:12px; color:var(--muted); font-weight:500; }

/* Tablero */
.board { display:flex; gap:10px; align-items:flex-start; margin-bottom:16px; }
.board-col { flex:1; min-width:0; display:flex; flex-direction:column; gap:10px; }
.card { display:block; width:100%; padding:0; border:0; text-align:left; background:var(--surface); border-radius:16px; overflow:hidden; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:pan-y; }
.card img { display:block; width:100%; height:auto; min-height:90px; background:var(--soft); -webkit-user-drag:none; pointer-events:none; }
.card .placeholder { display:grid; place-items:center; height:150px; background:var(--soft); color:var(--muted); font-size:13px; font-weight:650; padding:12px; text-align:center; }
.card .card-body { padding:8px 11px 10px; display:flex; flex-direction:column; gap:2px; }
.card .price { font-size:14px; font-weight:750; color:var(--accent); }
.card .name { font-size:14px; font-weight:650; line-height:1.25; }
.card .site { font-size:12px; color:var(--muted); }
.card.pressed { transform:scale(.97); transition:transform .12s ease; }

/* Pósters */
.posters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px 10px; margin-bottom:16px; }
.poster { position:relative; display:flex; flex-direction:column; gap:6px; padding:0; border:0; background:transparent; text-align:left; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:pan-y; }
.poster .art { position:relative; aspect-ratio:2/3; border-radius:10px; overflow:hidden; background:var(--soft); }
.poster .art img { width:100%; height:100%; object-fit:cover; display:block; pointer-events:none; -webkit-user-drag:none; }
.poster .art .placeholder { position:absolute; inset:0; display:flex; align-items:flex-end; padding:8px; font-size:13px; font-weight:700; color:var(--muted); }
.poster .t { font-size:13px; font-weight:650; line-height:1.2; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.poster .m { font-size:11px; color:var(--muted); }
.stamp { position:absolute; top:10px; padding:3px 8px; border-radius:6px; font-size:12px; font-weight:800; letter-spacing:.5px; border:2px solid; opacity:0; }
.stamp.yes { left:8px; color:#a8e3b9; border-color:#a8e3b9; transform:rotate(-12deg); }
.stamp.no { right:8px; color:#f3b0b0; border-color:#f3b0b0; transform:rotate(12deg); }

/* Barra inferior */
.bottom-bar { display:flex; align-items:center; gap:6px; margin-top:14px; }
.bottom-bar h1 { margin:0 auto 0 0; font-size:19px; font-weight:700; letter-spacing:-.4px; color:var(--muted); overflow-wrap:anywhere; }
.icon-button { position:relative; display:grid; place-items:center; flex-shrink:0; width:44px; height:44px; border:0; border-radius:12px; background:transparent; color:var(--muted); font-size:24px; }
.sync.busy { animation:spin 1.1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.pending-dot { position:absolute; top:9px; right:9px; width:8px; height:8px; border-radius:50%; background:#e9c46a; }

/* Diálogos */
dialog { width:calc(100% - 28px); max-width:490px; max-height:88dvh; margin:auto; border:1px solid var(--line); border-radius:24px; background:var(--surface); color:var(--ink); padding:22px; overflow-y:auto; overscroll-behavior:contain; }
dialog::backdrop { background:#0008; }
dialog.sheet { width:100%; max-width:640px; margin:auto auto 0; border-radius:26px 26px 0 0; border-bottom:0; padding:10px 18px calc(18px + env(safe-area-inset-bottom)); }
dialog.sheet[open] { animation:up .2s ease; }
@keyframes up { from { transform:translateY(40px); opacity:.4; } }
.grab { width:40px; height:4px; border-radius:4px; background:var(--line); margin:0 auto 16px; }
.dialog-head { display:flex; align-items:center; gap:8px; margin-bottom:18px; }
.dialog-head h2 { flex:1; margin:0; font-size:20px; font-weight:650; }
.field { margin:0 0 16px; }
.field label { display:block; margin-bottom:6px; font-size:14px; color:var(--muted); }
.field input:not([type="checkbox"]),.field select { width:100%; min-height:48px; border:1px solid var(--line); border-radius:12px; background:var(--bg); padding:10px 12px; font-size:16px; }
.field input[type="color"] { padding:6px; }
.fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.check-row { display:flex; align-items:center; gap:10px; min-height:44px; }
.check-row input { width:20px; height:20px; accent-color:var(--accent); }
.actions { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:18px; }
.button { display:inline-flex; align-items:center; justify-content:center; min-height:46px; border:1px solid var(--line); border-radius:13px; background:var(--soft); padding:10px 16px; color:var(--ink); text-decoration:none; font-size:15px; }
.primary { color:var(--on-accent); background:var(--accent); border-color:var(--accent); margin-left:auto; font-weight:700; }
.danger { color:var(--danger); background:transparent; }
.ghost-button { background:transparent; margin:0 auto; color:var(--muted); border:0; }
.form-error { color:var(--danger); font-size:14px; margin:0; }
.divider { border:0; border-top:1px solid var(--line); margin:22px 0; }
.section-head { display:flex; align-items:center; justify-content:space-between; }
.section-head h3 { margin:0; font-size:16px; font-weight:650; }
.category-setting { position:relative; display:flex; align-items:center; gap:2px; border-bottom:1px solid var(--line); padding:4px 0; background:var(--surface); touch-action:pan-y; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
.category-setting.lifted { background:var(--soft); border-radius:12px; box-shadow:0 8px 22px #0008; }
.category-setting .grip { color:var(--muted); width:40px; display:grid; place-items:center; opacity:.7; }
.chip { touch-action:pan-x; -webkit-touch-callout:none; }
.category-setting.inactive { opacity:.55; }
.category-setting .name-button { flex:1; min-width:0; display:flex; align-items:center; gap:9px; text-align:left; min-height:48px; border:0; background:transparent; padding:8px 0; }
.category-setting .view-label { font-size:12px; color:var(--muted); margin-left:auto; padding-right:6px; }
.category-setting .move { border:0; background:transparent; width:44px; height:44px; font-size:19px; color:var(--muted); }
.fineprint { font-size:12px; color:var(--muted); margin:0; }

.share-card { display:flex; gap:14px; align-items:center; margin-bottom:18px; }
.share-thumb { width:92px; height:92px; flex-shrink:0; border-radius:14px; background:var(--soft) center/cover no-repeat; display:grid; place-items:center; color:var(--muted); font-weight:700; }
.share-info { min-width:0; flex:1; display:flex; flex-direction:column; gap:4px; }
#share-title { border:0; border-bottom:1px solid var(--line); background:transparent; font-size:17px; font-weight:700; padding:4px 0; min-height:38px; width:100%; outline:none; }
#share-title:focus { border-bottom-color:var(--accent); }
.share-price { font-weight:750; color:var(--accent); }
.share-site { font-size:12px; color:var(--muted); }

.item-media { display:flex; justify-content:center; margin-bottom:14px; }
.item-media img { max-width:100%; max-height:240px; border-radius:14px; display:block; }
.item-meta { font-size:14px; color:var(--muted); margin:-4px 0 16px; }
.item-meta:empty { display:none; }
.steps-head { font-size:14px; color:var(--muted); margin-bottom:4px; }
.step { display:flex; align-items:center; gap:10px; min-height:44px; border-bottom:1px solid var(--line); }
.step input[type="checkbox"] { width:20px; height:20px; accent-color:var(--accent); margin:0; }
.step span { flex:1; overflow-wrap:anywhere; }
.step.done span { text-decoration:line-through; color:var(--muted); }
.step-add input { width:100%; min-height:46px; border:0; border-bottom:1px solid var(--line); background:transparent; padding:8px 0 8px 30px; font-size:16px; outline:none; }
.step-add input:focus { border-bottom-color:var(--accent); }

.toast { position:fixed; bottom:calc(18px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:calc(100% - 32px); max-width:500px; border-radius:16px; background:var(--ink); color:var(--bg); padding:6px 8px 6px 16px; display:flex; gap:10px; align-items:center; z-index:50; box-shadow:0 4px 24px #0004; }
dialog .toast { position:sticky; bottom:0; left:auto; transform:none; width:100%; margin-top:14px; }
.toast span { flex:1; min-width:0; font-size:14px; }
.toast button { border:0; background:transparent; color:inherit; min-height:44px; padding:0 8px; font-size:14px; font-weight:700; }
#toast-action { text-decoration:underline; }

@media (prefers-reduced-motion:reduce) { .sync.busy { animation:none; } dialog.sheet[open] { animation:none; } }
