/* =====================================================================
   Tinvito · asistente de creación y lista de eventos
   Usa las variables de la marca de invitaciones.css (--ink, --forest, --cream...).
   ===================================================================== */

[hidden] { display: none !important; }
.sr-only { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.editor-page { min-height: 100vh; margin: 0; background: #f4efe7; color: var(--ink); font-size: 1rem; }
.editor-bar { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: 10px clamp(14px, 3vw, 28px); display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(251, 247, 242, .94); backdrop-filter: blur(12px); }
.editor-back { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9375rem; color: var(--forest); white-space: nowrap; }
.editor-name { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 1.35rem/1.2 var(--serif); }
.editor-status { margin: 0; padding: 6px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap; color: #2f6b52; background: #e3f0e8; }
.editor-status[data-kind="pending"], .editor-status[data-kind="saving"] { color: #7a5a14; background: #f7ecd2; }
.editor-status[data-kind="error"] { color: #8f3129; background: #fbe4e1; }
.editor-open { font-size: .875rem; font-weight: 700; color: var(--forest); white-space: nowrap; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr); }
.editor-panel { padding: 18px clamp(14px, 3vw, 28px) 120px; }
.editor-steps { position: sticky; top: 64px; z-index: 10; margin: 0 -14px 22px; padding: 8px 14px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; background: #f4efe7; }
.editor-steps::-webkit-scrollbar { display: none; }
.editor-steps button { flex: none; min-height: 44px; padding: 8px 14px 8px 8px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 .9375rem/1 var(--sans); cursor: pointer; }
.editor-steps button span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font-size: .8125rem; background: var(--sand); }
.editor-steps button[aria-selected="true"] { color: #fff; border-color: var(--forest); background: var(--forest); }
.editor-steps button[aria-selected="true"] span { color: var(--forest); background: #fff; }

.editor-step { display: grid; gap: 22px; }
.field-group { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.field-group legend { padding: 0 6px; margin-left: -6px; font: 400 1.35rem/1.2 var(--serif); }
.help { margin: 6px 0 14px; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.field { display: grid; gap: 6px; margin: 0; }
.field > span { font-size: .875rem; font-weight: 700; }
.field input, .field select, .field textarea, .item-list input, .item-list select, .item-list textarea, .review-link input { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid rgba(37,72,61,.2); border-radius: 12px; background: #fff; color: var(--ink); font: 400 1rem/1.4 var(--sans); }
.field textarea, .item-list textarea { resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus, .item-list :is(input, select, textarea):focus { outline: 3px solid rgba(37,72,61,.18); border-color: var(--forest); }
.field small.help { margin: 0; }
.field-error { color: #9b2f25; font-size: .8125rem; font-weight: 600; }
.field-error:empty { display: none; }
.has-error input, .has-error textarea, .has-error select { border-color: #c2473a; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field-small { max-width: 220px; }
.field-inline { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: .875rem; }
.field-inline input[type="color"] { width: 54px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.texts-form { display: grid; gap: 16px; }
.group-title { margin: 10px 0 0; font: 400 1.25rem/1.2 var(--serif); }
.text-button { min-height: 44px; padding: 6px 8px; border: 0; background: none; color: var(--forest); font-weight: 700; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-danger { color: #9b2f25; }
.advanced summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .875rem; cursor: pointer; }
.advanced summary span { color: var(--muted); font-weight: 400; }

/* Plantillas */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.template-card { position: relative; display: grid; gap: 6px; padding: 8px 8px 12px; border: 2px solid transparent; border-radius: 18px; background: #faf7f2; cursor: pointer; transition: border-color .2s, transform .2s; }
.template-card:hover { transform: translateY(-2px); }
.template-card input { position: absolute; opacity: 0; }
.template-card:has(input:checked) { border-color: var(--forest); background: #fff; box-shadow: 0 10px 26px rgba(29,54,46,.12); }
.template-card:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
.template-swatch { position: relative; height: 120px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: var(--hi); background: radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--d) 55%, transparent), transparent 40%), var(--h); }
.template-swatch b { position: relative; z-index: 1; font: 400 2.6rem/1 var(--f); }
.template-swatch i { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--hi); bottom: 10px; }
.template-swatch i:nth-of-type(1) { left: 10px; background: var(--a); }
.template-swatch i:nth-of-type(2) { left: 30px; background: var(--d); }
.template-swatch i:nth-of-type(3) { left: 50px; background: var(--b); }
.template-name { padding: 0 4px; font-weight: 700; font-size: .9375rem; }
.template-name em { color: #b07b18; font-style: normal; }
.template-desc { padding: 0 4px; color: var(--muted); font-size: .8125rem; line-height: 1.35; }

.palette-row { display: flex; flex-wrap: wrap; gap: 10px; }
.palette { position: relative; display: grid; justify-items: center; gap: 6px; padding: 8px 10px; border: 2px solid transparent; border-radius: 14px; cursor: pointer; font-size: .8125rem; font-weight: 600; }
.palette input { position: absolute; opacity: 0; }
.palette:has(input:checked) { border-color: var(--forest); background: #faf7f2; }
.palette:has(input:focus-visible) { outline: 3px solid var(--forest); }
.palette-swatch { width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--h) 0 50%, var(--a) 0 70%, var(--d) 0 85%, var(--b) 0); box-shadow: inset 0 0 0 3px #fff, 0 0 0 1px var(--line); }
.accent-row { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.segmented { display: inline-flex; padding: 4px; border-radius: 14px; background: #f1ece4; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { min-height: 40px; padding: 8px 16px; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-size: .875rem; cursor: pointer; }
.segmented input:checked + span { color: #fff; background: var(--forest); }
.segmented input:focus-visible + span { outline: 3px solid var(--forest); }
.segmented-small span { min-height: 34px; padding: 6px 12px; font-size: .8125rem; }

/* Idiomas */
.locale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.locale-item { padding: 10px 12px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 14px; }
.check { min-height: 32px; display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input, .locale-default input { width: 20px; height: 20px; accent-color: var(--forest); }
.locale-default { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); cursor: pointer; }
.lang-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-tabs button { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 600 .875rem var(--sans); cursor: pointer; }
.lang-tabs button[aria-selected="true"] { color: #fff; border-color: var(--rose); background: #9d5f58; }

/* Programa y detalles */
.item-list { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: item; }
.item-list > li { padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: #fcfaf7; }
.item-head { display: flex; align-items: center; gap: 8px; }
.item-head .icon-select { width: 72px; font-size: 1.2rem; }
.item-head input[type="time"] { width: 130px; }
.item-tools { margin-left: auto; display: flex; gap: 4px; }
.item-tools button, .media-tools button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 1rem; cursor: pointer; }
.item-tools button:disabled, .media-tools button:disabled { opacity: .35; cursor: default; }
.item-tools .danger, .media-tools .danger { color: #9b2f25; }
.field-compact > span { font-size: .8125rem; }
.add-button { min-height: 48px; width: 100%; border: 2px dashed rgba(37,72,61,.25); border-radius: 14px; background: none; color: var(--forest); font: 700 .9375rem var(--sans); cursor: pointer; }
.add-button:hover { background: #fff; }

/* Archivos */
.media-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 12px; }
.media-group[data-media="music"] .media-items { grid-template-columns: 1fr; }
.media-item { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #faf7f2; }
.media-item img, .media-item video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.media-item audio { width: 100%; margin: 10px 0 0; }
.media-item figcaption { padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .75rem; color: var(--muted); }
.media-item figcaption > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tools { display: flex; gap: 4px; flex: none; }
.media-empty { margin: 0; color: var(--muted); font-size: .875rem; }
.upload-button { position: relative; min-height: 48px; padding: 10px 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: #fff; background: var(--forest); font-weight: 700; cursor: pointer; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-button:focus-within { outline: 3px solid rgba(37,72,61,.35); outline-offset: 2px; }
.upload-button.is-disabled { opacity: .45; pointer-events: none; }
progress { width: 100%; height: 8px; margin-top: 10px; accent-color: var(--forest); }

/* Efectos */
.effects-list { display: grid; gap: 10px; }
.effect { padding: 16px; display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; }
.effect span { display: grid; gap: 2px; }
.effect strong { font-size: 1rem; }
.effect small { color: var(--muted); font-size: .875rem; line-height: 1.4; }
.effect .effect-warning { color: #8a5a10; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: #d6d1c8; cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch:checked { background: var(--forest); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

/* Revisar */
.review-link { display: flex; gap: 8px; }
.review-link input { flex: 1; min-width: 0; font-size: .875rem; }
.review-actions { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.checklist { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 8px; }
.checklist li { min-height: 36px; padding-left: 36px; position: relative; display: flex; align-items: center; }
.checklist li::before { content: ''; position: absolute; left: 0; width: 24px; height: 24px; border: 2px solid #c9c3b8; border-radius: 50%; }
.checklist li.is-done::before { content: '✓'; display: grid; place-items: center; color: #fff; border-color: var(--forest); background: var(--forest); font-size: .8125rem; font-weight: 800; }
.messages { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.messages li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; display: flex; justify-content: space-between; gap: 10px; }
.messages li.is-hidden { opacity: .5; }
.messages blockquote { margin: 0; }
.messages cite { display: block; margin-top: 4px; font-size: .8125rem; font-style: normal; font-weight: 700; color: var(--forest); }
.danger-zone { text-align: right; }
.step-nav { margin-top: 26px; display: flex; justify-content: space-between; gap: 10px; }
.step-nav [hidden] + button, .step-nav button:only-child { margin-left: auto; }

/* Vista previa */
.editor-preview { position: fixed; inset: 0; z-index: 40; padding: 12px; display: none; flex-direction: column; align-items: center; gap: 10px; background: #26302c; }
.show-preview .editor-preview { display: flex; }
.preview-tools { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.preview-tools .segmented { background: rgba(255,255,255,.12); }
.preview-tools .segmented span { color: #fff; }
.preview-tools .segmented input:checked + span { color: var(--forest); background: #fff; }
.preview-lang select { min-height: 36px; padding: 4px 10px; border-radius: 10px; border: 0; font-weight: 700; }
.preview-envelope { min-height: 36px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: transparent; color: #fff; font-weight: 700; font-size: .8125rem; cursor: pointer; }
.preview-close { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 999px; background: #fff; color: var(--forest); font-weight: 700; cursor: pointer; }
.device { flex: 1; width: 100%; min-height: 0; display: flex; justify-content: center; }
.device iframe { width: 100%; height: 100%; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 30px 70px rgba(0,0,0,.35); }
.preview-fab { position: fixed; z-index: 30; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); min-height: 52px; padding: 12px 22px; border: 0; border-radius: 999px; color: #fff; background: var(--forest); font: 700 1rem var(--sans); box-shadow: 0 14px 30px rgba(23,53,44,.35); cursor: pointer; }
.show-preview .preview-fab { display: none; }

@media (min-width: 1100px) {
    .editor { grid-template-columns: minmax(460px, 560px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: calc(100vh - 123px); }
    .editor-panel { position: relative; overflow-y: auto; padding-bottom: 60px; border-right: 1px solid var(--line); }
    .editor-steps { top: -18px; flex-wrap: wrap; margin: -18px 0 22px; padding: 18px 0 10px; box-shadow: 0 10px 14px -12px rgba(29,54,46,.25); }
    .editor-steps button { min-height: 40px; padding: 6px 12px 6px 6px; gap: 6px; font-size: .875rem; }
    .editor-steps button span { width: 26px; height: 26px; }
    .editor-preview { position: relative; inset: auto; z-index: 1; display: flex; padding: 16px 24px 24px; background: radial-gradient(circle at 50% 20%, #3a4640, #1f2825 70%); }
    .preview-close, .preview-fab { display: none; }
    .device-phone iframe { width: 390px; max-height: 844px; border-radius: 34px; border: 10px solid #111; }
    .device-desktop iframe { width: 100%; }
}
@media (max-width: 1099px) {
    .editor-open { display: none; }
    .device-phone iframe { max-width: 430px; }
}
@media (max-width: 560px) {
    .editor-bar { gap: 10px; }
    .editor-back { font-size: 0; gap: 0; }
    .editor-back span { font-size: 1.3rem; }
    .field-group { padding: 16px; border-radius: 16px; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   Lista de eventos y creación
   ===================================================================== */
.events-shell { width: min(100% - 32px, 1100px); margin: 10px auto 80px; }
.events-head { margin: 20px 0 28px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.events-head h1 { margin: 6px 0 8px; font: 400 clamp(2.4rem, 6vw, 3.6rem)/1 var(--serif); }
.events-head p:not(.eyebrow) { max-width: 560px; margin: 0; color: var(--muted); }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.event-card { overflow: hidden; display: grid; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 16px 40px rgba(29,54,46,.08); }
.event-cover { height: 160px; padding: 16px; display: flex; align-items: flex-end; color: var(--hi); background: radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--d) 50%, transparent), transparent 45%), var(--h) center / cover; }
.event-cover strong { font: 400 1.7rem/1.05 var(--f); text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.event-body { padding: 16px 18px 18px; display: grid; gap: 8px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .875rem; }
.event-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .04em; color: #7a5a14; background: #f7ecd2; }
.event-status-active { color: #2f6b52; background: #e3f0e8; }
.event-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.events-empty { padding: 40px; border: 2px dashed rgba(37,72,61,.2); border-radius: 22px; text-align: center; color: var(--muted); }
.create-card { max-width: 860px; margin: 0 auto; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: var(--account-shadow); }
.create-card h1 { margin: 6px 0 10px; font: 400 clamp(2.3rem, 6vw, 3.4rem)/1 var(--serif); }
.type-groups { display: grid; gap: 18px; margin: 20px 0 26px; }
.type-group h2 { margin: 0 0 8px; font-size: .8125rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.type-options { display: flex; flex-wrap: wrap; gap: 8px; }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option span { min-height: 44px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; font-size: .9375rem; cursor: pointer; }
.type-option input:checked + span { color: #fff; border-color: var(--forest); background: var(--forest); }
.type-option input:focus-visible + span { outline: 3px solid var(--forest); outline-offset: 2px; }
.create-fields { display: grid; gap: 16px; }
.create-actions { margin-top: 26px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* =====================================================================
   Catálogo público de plantillas (/plantillas)
   ===================================================================== */
.templates-shell { width: min(100% - 32px, 1240px); margin: 10px auto 90px; }
.templates-head { max-width: 760px; margin: 30px auto 40px; text-align: center; }
.templates-head h1 { margin: 8px 0 14px; font: 400 clamp(2.6rem, 7vw, 4.6rem)/1 var(--serif); letter-spacing: -.03em; }
.templates-head > p:not(.eyebrow) { color: var(--muted); font-size: 1.0625rem; }
.templates-filter { margin-top: 22px; display: inline-flex; }
.templates-filter label { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9375rem; }
.templates-filter select { min-height: 46px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 500 1rem var(--sans); }
.templates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 26px; }
.template-tile { display: grid; gap: 14px; }
.template-frame { position: relative; aspect-ratio: 390 / 700; overflow: hidden; border-radius: 26px; background: #e9e2d7; box-shadow: 0 22px 50px rgba(29,54,46,.14); }
.template-frame iframe { position: absolute; left: 0; top: 0; width: 390px; height: 700px; border: 0; transform-origin: 0 0; transform: scale(var(--s, .7)); pointer-events: none; }
.template-frame-link { position: absolute; inset: 0; }
.template-info h2 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 400 1.6rem/1.1 var(--serif); }
.template-badge { padding: 3px 10px; border-radius: 999px; font: 800 .6875rem/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #7a5a14; background: #f7ecd2; }
.template-info p { margin: 6px 0 10px; color: var(--muted); }
.template-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.template-dots span { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--h) 0 50%, var(--a) 0 70%, var(--d) 0 85%, var(--b) 0); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--line); }
.template-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.templates-note { margin: 50px auto 0; max-width: 640px; text-align: center; color: var(--muted); }
@media (max-width: 560px) {
    .templates-filter, .templates-filter label { width: 100%; }
    .templates-filter label { flex-direction: column; align-items: stretch; gap: 6px; }
    .templates-filter select { width: 100%; }
}

/* =====================================================================
   Pestañas del evento, confirmación y publicación
   ===================================================================== */
.event-tabs { padding: 10px clamp(14px, 3vw, 28px) 0; display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); background: #f4efe7; }
.event-tabs::-webkit-scrollbar { display: none; }
.event-tabs a { flex: none; min-height: 46px; padding: 10px 16px; display: inline-flex; align-items: center; border-bottom: 3px solid transparent; font-weight: 700; font-size: .9375rem; color: var(--muted); }
.event-tabs a:hover { color: var(--forest); }
.event-tabs a[aria-current="page"] { color: var(--forest); border-bottom-color: var(--forest); }
.event-state { flex: none; margin-left: auto; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 800; color: #7a5a14; background: #f7ecd2; }
.event-state-active { color: #2f6b52; background: #e3f0e8; }
.help-lead { margin: 0; font-size: .9375rem; }
.chip-list { margin: 0 0 6px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .875rem; color: var(--forest); background: #e7efe9; }
.chip-empty { color: var(--muted); font-size: .875rem; }
.check-inline { min-height: 40px; display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 600; cursor: pointer; }
.check-inline input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.check-row-inline { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.publish-box { padding: 22px; display: grid; gap: 16px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.publish-box.is-published { border-color: rgba(47,107,82,.35); background: linear-gradient(180deg, #f1f8f3, #fff 60%); }
.publish-head { display: flex; gap: 14px; align-items: flex-start; }
.publish-head h2 { margin: 0; font: 400 1.35rem/1.2 var(--serif); }
.publish-head .help { margin: 4px 0 0; }
.publish-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; font-size: 1.2rem; color: #fff; background: var(--forest); }
.publish-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.publish-actions form { margin: 0; }
.publish-actions .plan-chip { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }

/* =====================================================================
   Invitados y respuestas
   ===================================================================== */
.panel-main { width: min(100% - 28px, 1120px); margin: 20px auto 90px; display: grid; gap: 22px; }
.panel-main > .form-alert { margin: 0; }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.funnel-card { position: relative; padding: 16px 18px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.funnel-card strong { font: 400 2.2rem/1.1 var(--serif); }
.funnel-label { font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.funnel-sub { font-size: .875rem; color: var(--muted); }
.funnel-yes { border-color: rgba(47,107,82,.3); background: #f1f8f3; }
.funnel-yes strong { color: #2f6b52; }
.funnel-no strong { color: #9b2f25; }
.meter { margin-top: 8px; height: 6px; border-radius: 99px; overflow: hidden; background: #ece6dc; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.guests-panel { padding: 20px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.guests-toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.guests-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.guests-filters .field { flex: 0 1 220px; }
.guests-filters .field-search { flex: 1 1 260px; }
.guests-filters input, .guests-filters select { min-height: 44px; }
.guests-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.guests-head .text-button:disabled { opacity: .35; cursor: default; text-decoration: none; }
.guest-list { margin: 0; padding: 0; list-style: none; display: grid; }
.guest-row { padding: 14px 4px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "check main status" "check track track" "check actions actions"; align-items: center; gap: 6px 12px; border-bottom: 1px solid var(--line); }
.guest-row:last-child { border-bottom: 0; }
.guest-check { grid-area: check; align-self: start; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--forest); }
.guest-main { grid-area: main; display: grid; gap: 3px; min-width: 0; }
.guest-name { font-size: 1.0625rem; overflow-wrap: anywhere; }
.guest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; color: var(--muted); }
.chip-small { padding: 2px 10px; font-size: .75rem; }
.guest-note { font-size: .8125rem; color: #8a5a10; }
.guest-message { font-size: .875rem; font-style: italic; color: var(--ink); overflow-wrap: anywhere; }
.guest-status { grid-area: status; justify-self: end; padding: 4px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 700; white-space: nowrap; color: #6b5d45; background: #f1ece3; }
.status-accepted { color: #2f6b52; background: #e3f0e8; }
.status-declined { color: #8f3129; background: #fbe4e1; }
.guest-track { grid-area: track; font-size: .8125rem; color: var(--muted); }
.track-sent { color: #7a5a14; }
.track-opened { color: #2f6b52; font-weight: 600; }
.track-opened::before { content: '● '; }
.guest-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button-whatsapp { color: #fff; background: #1f9d55; }
.button-whatsapp:hover { background: #17864a; }
.menu { position: relative; }
.menu summary { width: 40px; height: 40px; display: grid; place-items: center; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 1.2rem; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; display: grid; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 40px rgba(29,54,46,.16); }
.menu-items form { margin: 0; }
.menu-items a, .menu-items button { width: 100%; min-height: 42px; padding: 8px 12px; display: flex; align-items: center; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 600 .875rem var(--sans); text-align: left; cursor: pointer; }
.menu-items a:hover, .menu-items button:hover { background: #f4efe7; }
.menu-items .text-danger { color: #9b2f25; }
@media (min-width: 860px) {
    .guest-row { grid-template-columns: auto minmax(0, 1fr) 150px 150px auto; grid-template-areas: "check main status track actions"; }
    .guest-status { justify-self: start; }
    .guest-actions { flex-wrap: nowrap; }
}

.panel-dialog { width: min(100% - 24px, 620px); max-height: min(92vh, 900px); padding: 0; border: 0; border-radius: 22px; box-shadow: 0 30px 80px rgba(20,35,30,.3); color: var(--ink); }
.panel-dialog::backdrop { background: rgba(20, 30, 26, .45); }
.dialog-form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head { padding: 18px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { margin: 0; font: 400 1.5rem/1.2 var(--serif); }
.dialog-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f4efe7; font-size: 1.4rem; cursor: pointer; }
.dialog-body { padding: 6px 20px 16px; display: grid; gap: 14px; overflow-y: auto; }
.dialog-foot { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: #fcfaf7; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-legend { padding: 0; margin-bottom: 4px; font-size: .875rem; font-weight: 700; }

.import-summary { margin: 0 0 6px; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.import-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.import-table th, .import-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-table th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #faf7f2; }
.import-table tr:last-child td { border-bottom: 0; }
.import-table .is-bad { background: #fdf0ee; }
.import-table .is-bad .import-state { color: #9b2f25; font-weight: 600; }
.import-table .is-duplicate { color: var(--muted); }
.import-table .is-ok .import-state { color: #2f6b52; font-weight: 800; }
.import-actions { margin-top: 16px; }

.answers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.answers-grid .group-title { margin: 0 0 12px; }
.bars { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.bar-label { font-weight: 600; font-size: .9375rem; }
.bar-value { font-size: .875rem; color: var(--muted); }
.bar { grid-column: 1 / -1; grid-row: 2; height: 10px; border-radius: 99px; overflow: hidden; background: #ece6dc; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.answer-texts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.answer-texts li { padding: 12px 14px; border-radius: 14px; background: #faf7f2; }
.answer-texts p { margin: 0 0 4px; overflow-wrap: anywhere; }
.answer-texts cite { font-style: normal; font-size: .8125rem; color: var(--muted); font-weight: 600; }
.history { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.history li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.history small { color: var(--muted); }
.export-box { grid-template-columns: 1fr auto; align-items: center; }
@media (max-width: 640px) { .export-box { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
    .panel-main { width: min(100% - 20px, 1120px); }
    .guests-panel { padding: 14px; }
    .guest-actions .button-small { padding: 8px 13px; }
    .guests-toolbar .button-small { flex: 1 1 auto; }
    .guests-filters .field { flex: 1 1 100%; }
}
