@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/nunito-latin.woff2) format('woff2'); }

:root {
  --bg: #FBF8F3; --surface: #FFFFFF; --surface-2: #F4EFE7; --ink: #1E2B33; --muted: #4C5A63; --line: #E4DCCF;
  --primary: #23706A; --primary-dark: #1A5751; --primary-soft: #E2F0EC; --on-primary: #FFFFFF;
  --accent: #F2B544; --accent-soft: #FDF1D6; --coral: #C9573C;
  --yes: #24804F; --yes-soft: #E3F4EA; --no: #B83A2A; --no-soft: #FBE7E3;
  --radius: 18px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(30,43,51,.06), 0 6px 18px rgba(30,43,51,.06);
  --tap: 52px; --nav-h: 68px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body { font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
a { color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 800; }
p { margin: 0 0 .6rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1:focus { outline: none; }
.ico { display: inline-flex; line-height: 0; }
.ico svg { display: block; }

/* ---------- Estructura ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(251,248,243,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 90px); }
main:focus { outline: none; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nav-h); text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 700; }
.nav a.active { color: var(--primary-dark); }
.nav a.active .ico { background: var(--primary-soft); border-radius: 999px; padding: 3px 14px; }
@media (min-width: 900px) {
  .nav { position: sticky; top: 61px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; gap: 6px; padding: 0; background: var(--bg); }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 0 18px; min-height: 54px; font-size: .95rem; }
  .nav a.active .ico { padding: 3px 8px; }
  .topbar { order: 0; } .nav { order: 1; } main { order: 2; }
  main { padding-bottom: 110px; }
  .topbar { justify-content: space-between; }
}
body.playing .topbar, body.playing .nav { display: none; }
body.playing main { padding: 0; max-width: none; }
.loading-view { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 20px; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; touch-action: manipulation; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--no); color: #fff; }
.btn-lg { min-height: 60px; font-size: 1.1rem; padding: 12px 26px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border-radius: 999px; border: 0; background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.btn-icon:hover { background: var(--surface-2); }
.btn-icon:disabled { opacity: .3; }
.btn-ghost.btn-icon { border: 0; }
.danger { color: var(--no) !important; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Inicio ---------- */
.hero { text-align: center; padding: 10px 6px 18px; }
.hero-title { font-size: clamp(1.7rem, 5vw, 2.4rem); color: var(--primary-dark); margin-bottom: .4rem; }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 560px; margin: 0 auto; }
.ai-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; max-width: 760px; margin: 0 auto 18px; border: 2px solid var(--primary-soft); }
.ai-label { display: flex; align-items: center; gap: 6px; font-size: 1.35rem; font-weight: 800; color: var(--primary-dark); }
.hint { color: var(--muted); font-size: .95rem; }
textarea, input[type=text], input[type=search], input[type=email], input[type=password], select {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink); background: #FFFDF9; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; min-height: var(--tap); }
textarea { resize: vertical; min-height: 92px; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
#situation { font-size: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.chips-label { color: var(--muted); font-size: .9rem; font-weight: 700; }
.chip { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .92rem; cursor: pointer; min-height: 40px; }
.chip:hover { border-color: var(--primary); }
.chip-photo { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); border-color: #EBD49E; }
.chip-photo img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.ai-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 12px; }
.ai-foot .btn { flex: 1 1 260px; }
.for { color: var(--muted); }
.privacy-line { color: var(--muted); font-size: .85rem; margin-top: 10px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.privacy-line > svg, .privacy-line > .ico { flex: none; margin-top: 2px; color: var(--primary-dark); }
.privacy-line > span { flex: 1 1 auto; min-width: 0; }
.photo-hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; max-width: 180px; line-height: 1.35; }
.prof-photo-col { display: flex; flex-direction: column; align-items: center; flex: none; }
.item-hint { font-size: .85rem; color: var(--muted); margin: -2px 0 8px; }
@media (max-width: 520px) { .prof-photo-col { flex-direction: row; align-items: center; gap: 14px; width: 100%; } .photo-hint { max-width: none; margin: 0; flex: 1; } }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 760px; margin: 0 auto 26px; }
.quick-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; min-height: 120px; justify-content: center; }
.quick-card .ico { color: var(--primary); }
.quick-card strong { font-size: 1rem; }
.quick-card span:last-child { color: var(--muted); font-size: .82rem; }
.quick-card:hover { border-color: var(--primary); }
@media (max-width: 520px) { .quick { grid-template-columns: 1fr; } .quick-card { flex-direction: row; justify-content: flex-start; min-height: 64px; text-align: left; gap: 12px; } .quick-card span:last-child { display: none; } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.recent { max-width: 1000px; margin: 0 auto; }
.empty { color: var(--muted); background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }

/* Tarjetas de secuencia */
.seq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.seq-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); overflow: hidden; border: 1.5px solid transparent; }
.seq-card:hover { border-color: var(--primary-soft); }
.seq-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px; background: var(--surface-2); min-height: 80px; }
.seq-thumbs .picto-img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 8px; }
.seq-thumbs-empty { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.seq-info { padding: 10px 60px 12px 14px; display: flex; flex-direction: column; }
.seq-title { font-size: 1.05rem; }
.seq-meta { color: var(--muted); font-size: .85rem; }
.seq-play { position: absolute; right: 10px; bottom: 10px; width: 48px; height: 48px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Pie */
.footer { margin: 36px auto 0; max-width: 760px; text-align: center; color: var(--muted); font-size: .88rem; }
.footer .donate { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .85rem; text-decoration: underline; text-decoration-color: var(--line); }
.attrib { font-size: .78rem; color: var(--muted); }

/* ---------- Vistas generales ---------- */
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.view-head h1 { margin: 0; flex: 1; }
.lead { color: var(--muted); font-size: 1.05rem; }
.card-section { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; max-width: 760px; }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; font-weight: 700; }
.check input { width: 26px; height: 26px; accent-color: var(--primary); }
.sync-status { color: var(--muted); }
.sync-status.err { color: var(--no); }
.acc-form { display: grid; gap: 10px; max-width: 420px; }
.field-label { font-weight: 800; display: block; margin-bottom: 6px; }

/* Menú */
.menu-pop { position: fixed; z-index: 60; background: var(--surface); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.18); padding: 6px; min-width: 230px; max-width: calc(100vw - 16px); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 12px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; border-radius: 10px; cursor: pointer; }
.menu-item:hover, .menu-item.on { background: var(--primary-soft); }
.child-chip { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; max-width: 52vw; }
.child-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-empty { background: var(--primary-soft); color: var(--primary-dark); }
.avatar-xl { width: 92px; height: 92px; }

/* Diálogos */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: rgba(20,30,36,.45); }
.dialog { border-radius: 20px; padding: 22px; max-width: 420px; width: calc(100% - 32px); }
.dialog-msg { font-size: 1.1rem; font-weight: 700; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.sheet { width: min(760px, 100%); max-width: 100%; max-height: 92vh; border-radius: 22px; margin: auto; display: flex; flex-direction: column; overflow: hidden; }
.sheet[open] { display: flex; }
.sheet-wide { width: min(1100px, 100%); }
@media (max-width: 640px) { .sheet { margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 94vh; width: 100%; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 6px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; }
.sheet-body { overflow: auto; padding: 14px 18px 22px; }
.sheet-section { margin-top: 16px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.update-bar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 120; background: var(--accent); border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 800; cursor: pointer; }

/* Búsqueda */
.search-row { display: flex; gap: 8px; }
.search-row .btn-icon { min-width: 54px; min-height: 54px; }
.search-status { color: var(--muted); margin: 8px 0 0; min-height: 1.2em; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 8px; }
.result { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; background: #fff; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; font-size: .8rem; color: var(--ink); min-height: 120px; }
.result img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; }
.result span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result:hover, .result:focus-visible { border-color: var(--primary); }
.photo-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.prof-gallery { margin-top: 16px; }

/* ---------- Editor ---------- */
.editor-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.title-input { font-size: 1.3rem !important; font-weight: 800; border-color: transparent !important; background: transparent !important; padding-left: 6px !important; }
.title-input:focus { border-color: var(--primary) !important; background: #fff !important; }
.editor-opts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 12px; }
.opt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; }
.prof-select { width: auto; min-width: 160px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.seg-btn { min-height: 44px; padding: 6px 16px; border-radius: 999px; border: 0; background: transparent; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; }
.seg-btn.on { background: var(--surface); color: var(--primary-dark); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.seg-sm .seg-btn { min-height: 38px; padding: 4px 12px; font-size: .9rem; }
.gen-banner { background: var(--primary-soft); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.gen-banner p { margin: 0; color: var(--ink); flex: 1 1 240px; }
.gen-banner[data-by=local] { background: var(--accent-soft); }
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 1000px) { .editor-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } .editor-preview { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; } }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.steps-empty { color: var(--muted); padding: 18px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; }
.step { display: flex; gap: 8px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 10px 8px 4px; border-left: 6px solid var(--primary-soft); }
.step.step-no { border-left-color: var(--no-soft); }
.step.dragging { box-shadow: 0 16px 40px rgba(0,0,0,.25); opacity: .95; }
.sort-placeholder { border: 2px dashed var(--primary); border-radius: var(--radius); background: var(--primary-soft); }
.step-side { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 40px; flex: none; }
.drag-handle { display: flex; align-items: center; justify-content: center; width: 40px; height: 48px; color: var(--muted); cursor: grab; touch-action: none; border-radius: 10px; }
.drag-handle:hover { background: var(--surface-2); }
.step-num { font-weight: 800; font-size: 1.25rem; color: var(--primary-dark); }
.step-main { flex: 1; min-width: 0; }
.step-top { display: flex; gap: 12px; flex-wrap: wrap; }
.step-pictos { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.step-fields { flex: 1 1 200px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.picto-slot { position: relative; }
.picto-btn { position: relative; width: 108px; height: 108px; padding: 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.picto-slot.small .picto-btn { width: 84px; height: 84px; }
.picto-btn:hover { border-color: var(--primary); }
.picto-btn .picto-img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.picto-btn .picto-img.is-photo { object-fit: cover; }
.picto-edit-badge { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 999px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.picto-remove { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--no); }
.group-item { display: flex; flex-direction: column; gap: 4px; width: 92px; }
.mini-label { padding: 6px 8px !important; min-height: 38px !important; font-size: .85rem !important; }
.add-to-group { width: 44px; height: 44px; align-self: center; border-radius: 999px; border: 2px dashed var(--line); background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.add-to-group:hover { border-color: var(--primary); color: var(--primary); }
.step-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.sign-toggle { display: inline-flex; gap: 6px; }
.sign-toggle .seg-btn { border: 2px solid var(--line); background: #fff; }
.sign-toggle .seg-btn.yes.on { background: var(--yes); border-color: var(--yes); color: #fff; }
.sign-toggle .seg-btn.no.on { background: var(--no); border-color: var(--no); color: #fff; }
.then-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.then-row .picto-btn { width: 84px; height: 84px; }
.then-row .step-text { flex: 1 1 140px; width: auto; }
.then-label { font-weight: 800; color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.add-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 2px dashed var(--primary-soft); }
.add-box h2 { display: flex; align-items: center; }
.editor-preview { background: var(--surface-2); border-radius: var(--radius); padding: 14px; }
.preview-title { font-size: 1rem; color: var(--muted); }
.preview-paper { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.ft-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ft-nav:empty { display: none; }
.flip { transform: scaleX(-1); display: inline-flex; }
.action-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 25; display: flex; gap: 10px; justify-content: center; padding: 10px 16px; background: linear-gradient(to top, var(--bg) 70%, rgba(251,248,243,0)); }
.action-bar .btn { flex: 1 1 0; max-width: 300px; }
@media (min-width: 900px) { .action-bar { bottom: 0; } }

/* ---------- Formatos (pantalla) ---------- */
.seqview { --pic: 120px; }
.picto-img { display: block; }
.picto-missing { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); font-weight: 700; text-align: center; border-radius: 10px; font-size: .8rem; padding: 4px; }
.pics-one .picto-img { width: var(--pic); height: var(--pic); object-fit: contain; }
.pics-one .picto-img.is-photo { object-fit: cover; border-radius: 12px; }
.pics-group { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mini { margin: 0; display: flex; flex-direction: column; align-items: center; width: calc(var(--pic) * .72); }
.mini .picto-img { width: calc(var(--pic) * .72); height: calc(var(--pic) * .72); object-fit: contain; }
.mini .picto-img.is-photo { object-fit: cover; border-radius: 10px; }
.mini figcaption { font-size: .78rem; font-weight: 800; text-align: center; line-height: 1.15; margin-top: 2px; }
/* agenda */
.fmt-agenda { display: flex; flex-direction: column; }
.fmt-agenda .blk { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 6px; border-bottom: 2px solid var(--line); }
.fmt-agenda .blk:last-child { border-bottom: 0; }
.fmt-agenda .blk-head { display: flex; gap: 8px; align-items: baseline; font-weight: 800; font-size: 1.35rem; }
.fmt-agenda .blk-num { color: var(--primary-dark); font-size: 1.6rem; }
.fmt-agenda .blk-group { flex-direction: column; align-items: stretch; }
.fmt-agenda .blk-group .blk-head { justify-content: center; text-align: center; font-size: 1.15rem; }
/* fila */
.fmt-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fmt-row .card { margin: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff; min-width: calc(var(--pic) + 20px); max-width: calc(var(--pic) * 2.6); }
.fmt-row .card figcaption { font-weight: 800; text-align: center; line-height: 1.2; }
.card-num { position: absolute; top: 4px; left: 8px; font-weight: 800; color: var(--primary-dark); }
/* primero / después */
.fmt-firstThen { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; --pic: 150px; }
.ft-panel { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; border-radius: 16px; border: 3px solid var(--line); text-align: center; }
.ft-first { border-color: var(--primary); background: var(--primary-soft); }
.ft-label { font-weight: 800; font-size: 1.3rem; }
.ft-text { font-weight: 800; font-size: 1.1rem; }
.ft-arrow { align-self: center; font-size: 2.2rem; font-weight: 800; color: var(--muted); }
/* reglas */
.fmt-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rule { margin: 0; border-radius: 16px; border: 3px solid var(--yes); background: var(--yes-soft); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rule-no { border-color: var(--no); background: var(--no-soft); }
.rule-pic { position: relative; background: #fff; border-radius: 12px; padding: 6px; display: flex; justify-content: center; }
.rule-cross { position: absolute; inset: 6px; pointer-events: none; }
.rule-cross::before, .rule-cross::after { content: ''; position: absolute; left: 50%; top: 50%; width: 118%; height: 9px; background: var(--no); border-radius: 6px; transform-origin: center; opacity: .88; }
.rule-cross::before { transform: translate(-50%, -50%) rotate(45deg); }
.rule-cross::after { transform: translate(-50%, -50%) rotate(-45deg); }
.rule figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-weight: 800; }
.sign { display: inline-block; padding: 2px 12px; border-radius: 999px; font-weight: 800; font-size: .95rem; color: #fff; }
.sign-si { background: var(--yes); }
.sign-no { background: var(--no); }
/* si... entonces */
.fmt-ifThen { display: flex; flex-direction: column; gap: 12px; --pic: 110px; }
.ift { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; border-radius: 16px; padding: 10px; border: 3px solid var(--yes); background: var(--yes-soft); }
.ift-no { border-color: var(--no); background: var(--no-soft); }
.ift-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ift-label { font-weight: 800; text-transform: uppercase; font-size: .85rem; color: var(--muted); letter-spacing: .04em; }
.ift-text { font-weight: 800; }
.ift-arrow { font-size: 2rem; font-weight: 800; color: var(--muted); }

/* ---------- Generación ---------- */
.gen-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(251,248,243,.92); display: flex; align-items: center; justify-content: center; padding: 20px; }
.gen-box { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 28px 24px; max-width: 420px; width: 100%; text-align: center; }
.gen-msg { font-size: 1.3rem; font-weight: 800; color: var(--primary-dark); }
.gen-sub { color: var(--muted); font-size: .92rem; }
.gen-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 14px 0; }
.gen-bar-fill { height: 100%; width: 8%; background: var(--primary); border-radius: 999px; transition: width .5s; }
.gen-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.gen-dots span { width: 16px; height: 16px; border-radius: 999px; background: var(--accent); animation: bob 1.2s infinite ease-in-out; }
.gen-dots span:nth-child(2) { animation-delay: .15s; background: var(--primary); }
.gen-dots span:nth-child(3) { animation-delay: .3s; background: var(--coral); }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: .6; } 40% { transform: translateY(-10px); opacity: 1; } }

/* ---------- Plantillas ---------- */
.tpl-section { margin-bottom: 22px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tpl-card { position: relative; }
.tpl-main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); font: inherit; color: var(--ink); cursor: pointer; text-align: center; min-height: 180px; }
.tpl-main:hover { border-color: var(--primary); }
.tpl-main.busy { opacity: .6; }
.tpl-rules .tpl-main { border-color: #DCCCA8; background: #FFFCF4; }
.tpl-pic .picto-img { width: 96px; height: 96px; object-fit: contain; }
.tpl-meta { color: var(--muted); font-size: .85rem; }
.tpl-del { position: absolute; top: 4px; right: 4px; }

/* ---------- Perfiles ---------- */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.prof-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 2px solid transparent; }
.prof-card.on { border-color: var(--primary); }
.prof-link { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.prof-link .meta { color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary-dark); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .9rem; }
.profile-edit { max-width: 820px; }
.prof-top { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin: 8px 0 6px; }
.prof-top-fields { flex: 1 1 260px; }
.prof-photo { width: 132px; height: 132px; border-radius: 999px; border: 3px dashed var(--line); background: var(--surface); overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 0; flex: none; }
.prof-photo img { width: 100%; height: 100%; object-fit: cover; }
.prof-photo span { display: flex; flex-direction: column; align-items: center; gap: 4px; font: inherit; }
.field { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.prof-top .field { box-shadow: none; padding: 0; background: none; }
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-row input[type=text] { flex: 1 1 160px; width: auto; }
.item-photo { width: 52px; height: 52px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; padding: 0; flex: none; }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.btn-add { align-self: flex-start; min-height: 46px; }
details.look summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.look-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; background: none; border-radius: 12px; padding: 4px 6px; cursor: pointer; font: inherit; font-size: .75rem; color: var(--ink); min-width: 62px; }
.swatch.on { border-color: var(--primary); background: var(--primary-soft); }
.swatch .dot { width: 30px; height: 30px; border-radius: 999px; border: 2px solid rgba(0,0,0,.15); }
.look-sample { display: flex; gap: 8px; background: #fff; border-radius: 12px; padding: 8px; }
.look-sample img { width: 84px; height: 84px; object-fit: contain; }

/* ---------- Modo paso a paso ---------- */
.play { position: fixed; inset: 0; z-index: 70; background: #FFFDF8; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); user-select: none; -webkit-user-select: none; }
.play-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 10px; }
.play-title { font-weight: 800; font-size: 1.15rem; color: var(--muted); text-align: center; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-tool { position: relative; width: 56px; height: 56px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.play-exit .hold-ring { position: absolute; inset: -4px; border-radius: 999px; border: 4px solid var(--primary); clip-path: inset(0 100% 0 0); transition: clip-path .1s; }
.play-exit.holding .hold-ring { clip-path: inset(0 0 0 0); transition: clip-path .8s linear; }
.play-hint { position: absolute; top: 74px; left: 14px; background: var(--ink); color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; opacity: 0; transition: .2s; pointer-events: none; z-index: 2; }
.play-hint.show { opacity: 1; }
.play-stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3vw; padding: 8px 4vw; min-height: 0; }
.play-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 28px; padding: 16px; background: #fff; border: 4px solid var(--line); text-align: center; position: relative; transition: transform .3s, opacity .3s; }
.play-card.now { flex: 1.6; max-width: 720px; border-color: var(--primary); box-shadow: 0 10px 36px rgba(35,112,106,.18); cursor: pointer; height: 100%; max-height: 70vh; }
.play-card.next { flex: 1; max-width: 380px; opacity: .72; height: 72%; max-height: 50vh; }
.play-role { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-weight: 800; padding: 4px 18px; border-radius: 999px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }
.play-card.next .play-role { background: var(--muted); font-size: .95rem; }
.play-img { width: auto; height: 100%; max-height: 44vh; max-width: 100%; object-fit: contain; flex: 1 1 auto; min-height: 0; margin-top: 30px; }
.play-img.is-photo { border-radius: 20px; object-fit: cover; aspect-ratio: 1; }
.play-card.next .play-img { max-height: 26vh; }
.play-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.play-group figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.play-group .picto-img { width: min(22vh, 20vw); height: min(22vh, 20vw); object-fit: contain; }
.play-group figcaption { font-weight: 800; font-size: 1rem; }
.play-card.next .play-group .picto-img { width: 11vh; height: 11vh; }
.play-text { font-size: clamp(1.4rem, 3.4vw, 2.6rem); font-weight: 800; line-height: 1.15; }
.play-card.next .play-text { font-size: clamp(1rem, 2vw, 1.5rem); }
.play-card.completing { transform: scale(.94); opacity: .4; }
.play-card.completing::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30vh; color: var(--yes); font-weight: 800; animation: pop .5s ease-out; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.play-strip { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 14px; margin: 0; scroll-snap-type: x proximity; }
.strip-item { position: relative; width: 84px; height: 84px; flex: none; border-radius: 16px; border: 3px solid var(--line); background: #fff; padding: 4px; cursor: pointer; }
.strip-item .picto-img { width: 100%; height: 100%; object-fit: contain; }
.strip-item.current { border-color: var(--primary); }
.strip-item.done .picto-img { opacity: .35; }
.strip-item.done::after { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 5px; background: var(--no); border-radius: 4px; transform: rotate(-35deg); }
.strip-check { position: absolute; right: -6px; top: -6px; width: 30px; height: 30px; border-radius: 999px; background: var(--yes); color: #fff; display: flex; align-items: center; justify-content: center; }
.strip-check svg { width: 18px; height: 18px; }
.strip-num { position: absolute; left: 4px; top: 0; font-weight: 800; font-size: .8rem; color: var(--muted); }
.play-finish { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.play-finish .play-img { max-height: 36vh; margin-top: 0; }
.play-finish-title { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; color: var(--yes); }
@media (orientation: portrait) { .play-stage { flex-direction: column; } .play-card.now { width: 100%; max-height: 54vh; } .play-card.next { width: 70%; max-height: 22vh; flex-direction: row; } .play-card.next .play-img { max-height: 14vh; margin-top: 18px; } .play-img { max-height: 34vh; } }

/* ---------- Diálogo de impresión ---------- */
.print-dialog { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 860px) { .print-dialog { grid-template-columns: 300px 1fr; } }
.print-opts { display: flex; flex-direction: column; gap: 10px; }
.print-preview-wrap { background: var(--surface-2); border-radius: 14px; padding: 14px; overflow: auto; max-height: 70vh; }
.a4 { background: #fff; width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: 210 / 297; box-shadow: var(--shadow); padding: 4%; overflow: hidden; font-size: 9px; }
.a4 .print-sheet { zoom: .62; }
#print-root { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.acc-delete { margin-top: 12px; font-size: .9rem; min-height: 44px; }
.btn.is-busy { animation: mp-pulse 1.2s ease-in-out infinite; }
@keyframes mp-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .btn.is-busy { animation: none; } }
.search-status { min-height: 1.2em; }
.search-row .btn.btn-primary.btn-icon { background: var(--primary); color: #fff; }
.search-row .btn.btn-primary.btn-icon:hover { filter: brightness(1.08); }
.results-more { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }
.result[hidden] { display: none; }
/* --- pulido celular (nov. 2026) --- */
.seg { flex-wrap: nowrap; max-width: 100%; }
.seg-btn { white-space: nowrap; }
@media (max-width: 520px) {
  .hero { padding: 4px 6px 12px; }
  .hero-title { font-size: 1.55rem; }
  .hero-sub { font-size: 1rem; }
  .ai-card { padding: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { white-space: nowrap; flex: 0 0 auto; }
  .seg-btn { padding: 6px 12px; font-size: .95rem; }
}
textarea.step-text { resize: none; overflow: hidden; line-height: 1.3; min-height: 50px; font-weight: 700; font-size: 1.05rem; }
.step-actions .btn-icon { min-width: 42px; min-height: 42px; }
@media (max-width: 520px) {
  .step { padding: 8px 6px 4px 2px; gap: 4px; }
  .step-side { width: 30px; }
  .step:not(.is-group) .step-top { flex-wrap: nowrap; gap: 10px; align-items: flex-start; }
  .step:not(.is-group) .step-pictos { flex-direction: column; align-items: center; gap: 6px; flex: none; }
  .step:not(.is-group) .step-fields { flex: 1 1 auto; }
  .picto-btn { width: 92px; height: 92px; }
  .add-to-group { width: 34px; height: 34px; }
  .step-actions { margin-top: -38px; }
  .step.is-group .step-actions, .step:has(.then-row) .step-actions, .step:has(.sign-toggle) .step-actions, .step:has(.suggest) .step-actions { margin-top: 2px; }
}
textarea.mini-label { resize: none; min-height: 0; height: auto; padding: 6px 8px; font-size: .85rem; line-height: 1.2; text-align: center; overflow: hidden; }
.results { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
@media (max-width: 520px) {
  .action-bar { padding: 8px 12px; gap: 8px; }
  .action-bar .btn-lg { min-height: 52px; font-size: 1.02rem; padding: 8px 14px; white-space: nowrap; }
}
.fmt-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--pic) + 24px), 1fr)); justify-items: stretch; }
.fmt-row .card { max-width: none; min-width: 0; }
.ft-pos { white-space: nowrap; }
@media (orientation: portrait) {
  .play-card.next { width: 88%; max-width: 460px; justify-content: flex-start; gap: 14px; padding: 14px 18px; }
  .play-card.next .play-text { text-align: left; flex: 1; font-size: 1.3rem; }
}
.then-row .step-text { min-width: 0; }
.step-fields > * { min-width: 0; max-width: 100%; }
@media (max-width: 520px) {
  .then-row { gap: 8px; }
  .then-row .step-text { flex: 1 1 100%; }
  .title-input { font-size: 1.15rem !important; }
}
.editor-col, .editor-preview { min-width: 0; }
.then-row input.step-text { width: 100%; }
@media (min-width: 521px) {
  .step:not(.is-group):not(:has(.then-row)):not(:has(.sign-toggle)):not(:has(.suggest)) .step-actions { margin-top: -48px; margin-left: auto; width: max-content; }
  .step:not(.is-group) .step-fields { padding-bottom: 0; }
}
@media (min-width: 1000px) { .editor-preview { max-height: calc(100vh - 240px); } .editor-grid { padding-bottom: 90px; } }
#toast { max-width: min(92vw, 460px); }
@media (max-width: 520px) {
  .gen-banner { padding: 10px 12px; gap: 2px 10px; font-size: .95rem; }
  .gen-banner p { display: none; }
  .gen-banner .btn { min-height: 40px; padding: 4px 10px; }
}
#toast { width: max-content; border-radius: 18px; }
body:has(.action-bar) #toast { bottom: calc(var(--nav-h) + 92px); }
@media (min-width: 900px) { body:has(.action-bar) #toast { bottom: 96px; } }
@media (orientation: portrait) {
  .play-card.next .play-img { max-width: 40%; flex: 0 0 auto; width: auto; }
  .play-card.next .play-text { flex: 1 1 0; min-width: 0; font-size: 1.25rem; line-height: 1.2; }
}
@media (max-width: 520px) {
  .field > .seg { display: flex; width: 100%; }
  .field > .seg .seg-btn { flex: 1 1 0; padding: 6px 4px; font-size: .92rem; }
}
.preview-empty { color: var(--muted); text-align: center; padding: 28px 12px; margin: 0; }

/* ---------- Compartir (nov. 2026) ---------- */
.btn-share { background: var(--accent); color: #3A2A05; }
.btn-share:hover { background: #E9A92F; }
.btn-wa { background: #1F8F4E; color: #fff; }
.btn-wa:hover { background: #187A42; }
.share-dialog .sheet-body { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.share-lead { color: var(--muted); }
.share-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.share-thumbs { display: flex; gap: 10px; overflow-x: auto; max-width: 100%; padding: 2px; }
.share-thumbs:empty { width: 150px; aspect-ratio: 210 / 297; background: #fff; border-radius: 6px; box-shadow: var(--shadow); animation: mp-pulse 1.2s ease-in-out infinite; }
.share-thumb { width: 150px; height: auto; aspect-ratio: 210 / 297; background: #fff; border-radius: 6px; box-shadow: var(--shadow); flex: none; }
.share-status { margin: 0; color: var(--muted); font-weight: 700; text-align: center; }
.share-actions { display: flex; flex-direction: column; gap: 10px; }
.share-main { width: 100%; }
.share-row { display: flex; justify-content: center; }
.share-row .btn { width: 100%; }
.share-more { margin-top: 18px; }
.share-more h3, .share-linkbox h3 { margin-bottom: 8px; }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share-grid .btn { padding: 10px 8px; font-size: .95rem; }
.share-fallback { margin-top: 8px; }
.share-linkbox { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-warn { display: flex; gap: 6px; align-items: flex-start; background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.share-warn .ico { flex: none; margin-top: 2px; color: var(--coral); }
.share-link-msg { margin-top: 8px; color: var(--primary-dark); font-weight: 700; word-break: break-all; }
.share-idea, .print-idea { margin: 18px 0 0; text-align: center; }
@media (max-width: 520px) { .share-grid { grid-template-columns: 1fr 1fr; } .share-grid .btn-wa { grid-column: 1 / -1; } .share-thumb, .share-thumbs:empty { width: 130px; } }
.shared-banner { display: flex; align-items: center; gap: 8px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; border-radius: 999px; padding: 8px 16px; width: fit-content; margin: 0 0 12px; }
.shared-paper { max-width: 760px; margin-bottom: 20px; }

/* acción del editor: 3 botones */
@media (max-width: 640px) {
  .editor .action-bar { gap: 6px; padding: 8px 8px; }
  .editor .action-bar .btn-lg { flex-direction: column; gap: 2px; min-height: 60px; padding: 6px 4px; font-size: .9rem; line-height: 1.1; white-space: normal; border-radius: 18px; }
}

/* ---------- Ideas ---------- */
.idea-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 10px 8px; min-height: 44px; font: inherit; font-weight: 800; color: var(--primary-dark); cursor: pointer; text-decoration: underline; text-decoration-color: var(--primary-soft); text-underline-offset: 4px; text-decoration-thickness: 2px; font-size: .95rem; }
.idea-link:hover { text-decoration-color: var(--primary); }
.footer-ideas { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.footer-ideas-q { font-weight: 800; color: var(--ink); font-size: .98rem; }
.footer-ideas-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 12px; }
.ideas { max-width: 820px; margin: 0 auto; }
.ideas-hero { text-align: center; padding: 6px 4px 14px; }
.ideas-hero h1 { color: var(--primary-dark); font-size: clamp(1.55rem, 5vw, 2.1rem); }
.ideas-hero .lead { max-width: 560px; margin: 0 auto 14px; }
.ideas-cta { min-width: min(100%, 300px); }
.ideas-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 8px; color: var(--muted); font-size: .88rem; font-weight: 700; margin-bottom: 14px; }
.ideas-bar { display: flex; justify-content: center; margin-bottom: 12px; }
.idea-tabs .seg-btn { min-width: 128px; }
.idea-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.idea-badge.st-approved { background: var(--accent-soft); color: #7A5200; }
.idea-badge.st-planned { background: #E3ECFA; color: #234B8C; }
.idea-badge.st-done { background: var(--yes-soft); color: #1B6A40; }
.idea-badge.st-pending { background: var(--surface-2); color: var(--muted); }
.idea-badge.st-rejected { background: var(--no-soft); color: var(--no); }
.idea-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.idea-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px 12px 12px; border: 1.5px solid transparent; }
.idea-card.st-done { border-color: var(--yes-soft); }
.idea-card.st-planned { border-color: #E3ECFA; }
.idea-vote { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 66px; min-height: 76px; border-radius: 16px; border: 2px solid var(--line); background: #FFFDF9; color: var(--primary-dark); font: inherit; cursor: pointer; padding: 6px 4px; }
.idea-vote:hover { border-color: var(--primary); }
.idea-vote.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.idea-vote-n { font-size: 1.25rem; font-weight: 800; line-height: 1.1; }
.idea-vote-l { font-size: .7rem; font-weight: 800; line-height: 1.1; text-align: center; }
.idea-main { flex: 1; min-width: 0; }
.idea-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.idea-cat-tag { font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.idea-text { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; white-space: pre-line; }
.idea-by { color: var(--muted); font-size: .85rem; margin: 0; }
.idea-status:empty { display: none; }
.idea-empty { text-align: center; color: var(--muted); background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius); padding: 24px 16px; list-style: none; }
.idea-empty .ico { color: var(--accent); justify-content: center; margin-bottom: 6px; }
.idea-empty.err { color: var(--ink); }
.idea-done-line { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--yes); font-weight: 800; margin-bottom: 10px; }
/* formulario */
.idea-dialog { max-width: 620px; }
.idea-form-lead { margin: 0; padding: 10px 20px 0; color: var(--muted); }
.idea-form-body { padding-top: 10px; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.idea-form { display: flex; flex-direction: column; }
.idea-form textarea { min-height: 120px; }
.idea-under { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 6px 0 14px; }
.idea-privacy { margin: 0; color: var(--muted); font-size: .88rem; display: flex; gap: 4px; align-items: flex-start; }
.idea-privacy .ico { flex: none; color: var(--coral); margin-top: 3px; }
.idea-count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.idea-count.warn { color: var(--coral); font-weight: 800; }
.opt-tag { font-weight: 600; color: var(--muted); font-size: .88rem; }
.idea-opt-label { margin-bottom: 6px; }
.idea-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.idea-cat { min-height: 44px; padding: 8px 16px; font-weight: 700; }
.idea-cat.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.idea-hp-wrap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.idea-msg { color: var(--no); font-weight: 700; margin: 10px 0 0; min-height: 0; }
.idea-msg:empty { display: none; }
.idea-actions { margin-top: 14px; display: flex; }
.idea-actions .btn { flex: 1; }
.idea-moderated { text-align: center; margin: 10px 0 0; font-size: .88rem; }
.idea-thanks { text-align: center; padding: 18px 6px 6px; }
.idea-thanks-ico { width: 76px; height: 76px; border-radius: 999px; background: var(--accent-soft); color: var(--coral); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.idea-thanks h3 { font-size: 1.35rem; color: var(--primary-dark); }
.row-btns.center { justify-content: center; margin-top: 12px; }
/* moderación */
.adm-tabs { margin: 8px 0 12px; }
.adm-tabs .seg-btn { min-width: 0; }
.adm-card { padding-left: 16px; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.adm-actions .btn { min-height: 44px; padding: 8px 14px; font-size: .92rem; }
@media (max-width: 520px) {
  .idea-card { gap: 10px; padding: 12px 12px 10px 10px; }
  .idea-vote { width: 58px; min-height: 70px; }
  .idea-text { font-size: 1rem; }
  .idea-tabs .seg-btn { min-width: 0; flex: 1; }
  .ideas-bar .seg { width: 100%; }
  .adm-tabs { overflow-x: auto; }
}
[hidden] { display: none !important; }
.share-grid.fb { grid-template-columns: 1fr 1fr; }
.share-grid.fb .btn-wa { grid-column: auto; }
@media (max-width: 520px) { .share-grid.fb { grid-template-columns: 1fr; } }

/* ---------- Pasada celular (nov. 2026, 2): toques ≥44 px y sin desbordes ---------- */
.brand { min-height: 44px; }
.chip { min-height: 44px; }
.footer .donate { min-height: 44px; padding: 0 6px; }
.seg-sm .seg-btn { min-height: 44px; }
.item-photo { font-size: .8rem; }
.gen-banner .btn { min-height: 44px; }
.step-actions .btn-icon { min-width: 44px; min-height: 44px; }
.ft-nav { flex-wrap: wrap; }
@media (max-width: 520px) {
  .add-to-group { width: 44px; height: 44px; }
  .gen-banner .btn { min-height: 44px; }
  .ft-nav .btn { padding: 8px 12px; font-size: .92rem; min-height: 44px; }
  .ft-nav .ft-pos { font-size: .9rem; }
}
.prof-photo small { font-size: .9rem; font-weight: 700; }
@media (max-width: 520px) {
  .ft-nav { flex-wrap: nowrap; gap: 6px; }
  .ft-nav .btn { padding: 6px 12px; font-size: .88rem; gap: 4px; }
}
.share-send-hint { text-align: center; margin: -2px 0 2px; font-size: .88rem; }
@media (max-width: 640px) {
  .shared-actions { gap: 6px; padding: 8px; }
  .shared-actions .btn-lg { flex-direction: column; gap: 2px; min-height: 60px; padding: 6px 4px; font-size: .92rem; line-height: 1.1; white-space: normal; border-radius: 18px; }
}

/* Versión de la IA en segundo plano (franja chica dentro del aviso, no bloquea) */
.gen-banner-text { flex: 1 1 260px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.gen-banner-text p { flex: 1 1 200px; }
.ai-strip { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.08); }
.ai-strip[hidden] { display: none; }
.ai-msg { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-right: auto; color: var(--ink); }
.ai-msg svg { color: var(--primary-dark); flex: none; }
.btn.btn-sm { min-height: 44px; padding: 6px 14px; font-size: .95rem; }
.ai-spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(0,0,0,.12); border-top-color: var(--primary-dark); animation: mp-spin .9s linear infinite; flex: none; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation: none; border-top-color: var(--primary); } }
.ai-compare .preview-paper { max-height: 62vh; overflow: auto; }
.ai-compare-actions { padding: 10px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .ai-strip { padding-top: 6px; } .ai-msg { flex: 1 1 100%; font-size: .95rem; } }
@media (max-width: 640px) { .ai-compare-actions .btn { flex: 1 1 140px; } }

/* Recorte de foto */
.crop-dlg { width: min(520px, 100%); }
.crop-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.crop-help { margin: 0; text-align: center; }
.crop-stage { position: relative; width: min(78vw, 400px, 52vh); aspect-ratio: 1; overflow: hidden; background: #222; border-radius: 12px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; flex: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.crop-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; will-change: transform; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(255,255,255,.95); box-shadow: 0 0 0 9999px rgba(0,0,0,.5); }
.crop-stage[data-shape=round] .crop-mask { border-radius: 50%; }
.crop-stage[data-shape=square] .crop-mask { border-radius: 4px; inset: 0; box-shadow: none; }
.crop-zoom-row { display: flex; align-items: center; gap: 8px; width: min(78vw, 400px); }
.crop-zoom { flex: 1; accent-color: var(--primary-dark); height: 44px; }
.crop-pm { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.crop-actions { padding: 10px 18px 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .crop-actions .btn { flex: 1 1 120px; } }
