/*** SuggestionsEditor.razor ***/
.suggestions-editor {
    width: 100%;
    min-width: 700px; /* Ancho mínimo para evitar modal estrecho */
}

.editor-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
}

.add-suggestion-btn {
    background: linear-gradient(90deg,rgba(182, 191, 191, 1) 23%, rgba(116, 82, 172, 1) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.add-suggestion-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.add-suggestion-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 16px;
    font-weight: bold;
}

.info-alert, .error-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 14px;
}

.info-alert {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
}

.info-alert.small {
    padding: 8px 12px;
    font-size: 13px;
    margin: 8px 0;
}

.error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
    line-height: 1.4;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.suggestion-card {
    background: white;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    min-width: 700px; /* Ancho mínimo consistente */
}

.suggestion-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.suggestion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: #1e293b;
}

.suggestion-number {
    background: #667eea;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.suggestion-type {
    font-size: 16px;
}

.card-actions {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.action-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.action-btn.danger {
    border-color: #fecaca;
    color: #dc2626;
}

.action-btn.danger:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #f87171;
}

.card-content {
    padding: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    flex: 1 1 100%;
}

.form-group.half-width {
    flex: 1 1 48%;
}

.form-group.third-width {
    flex: 1 1 32%;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.templates-builder-section-panel {
    overflow: hidden;
    border: 1px solid #d8deea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.templates-builder-section-panel__header-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8faff 0%, #f4f7fc 100%);
    border-bottom: 1px solid transparent;
    transition: background-color .18s ease, border-color .18s ease;
}

.templates-builder-section-panel__header {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: opacity .18s ease;
}

.templates-builder-section-panel__header:hover {
    opacity: .9;
}

.templates-builder-section-panel__header:focus-visible {
    outline: 2px solid #6F4CFF;
    outline-offset: -2px;
}

.templates-builder-section-panel__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    min-width: 0;
}

.templates-builder-section-panel__header-rail {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.templates-builder-section-panel__chevron-shell {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(111, 76, 255, 0.08);
    color: #5b3df5;
    flex-shrink: 0;
}

.templates-builder-section-panel__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.templates-builder-section-panel__toggle:focus-visible {
    outline: 2px solid #6F4CFF;
    outline-offset: 4px;
    border-radius: 999px;
}

.templates-builder-section-panel__chevron {
    transition: transform .2s ease;
}

.templates-builder-section-panel.is-expanded .templates-builder-section-panel__header-shell {
    border-bottom-color: #e7ebf3;
}

.templates-builder-section-panel.is-expanded .templates-builder-section-panel__chevron {
    transform: rotate(180deg);
}

.templates-builder-section-panel__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.templates-builder-section-panel__header-action-button {
    width: auto;
}

.templates-builder-section-panel__body {
    padding: 20px 20px 22px;
    background: #ffffff;
}

.templates-builder-delivery-panel {
    border: 1px solid #d8deea;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.templates-builder-delivery-panel__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
}

.templates-builder-delivery-panel__divider {
    margin: 0 0 20px;
}

.templates-builder-page__frame {
    position: relative;
}

.templates-builder-page__card {
    overflow: visible;
    border: 1px solid #d8deea;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.templates-builder-page__card-body {
    overflow: visible;
    padding: 20px 22px 22px;
}

.templates-builder-page__navigation {
    gap: 12px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    padding-bottom: 4px;
}

.templates-builder-page__debug {
    border-radius: 14px;
    border-color: #d8deea;
    background: #fbfcff;
}

.templates-builder-info-band {
    border-radius: 14px;
    border-color: #d6dfed;
    background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(244, 247, 252, 0.94) 100%);
    color: #28415f;
}

.templates-builder-info-band--stacked .mud-alert-message {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.templates-builder-shell {
    border: 1px solid #d8deea;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
    padding: 20px;
}

.templates-builder-shell--intro {
    background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(244, 247, 252, 0.94) 100%);
}

.templates-builder-shell--summary {
    padding: 22px;
}

.templates-builder-shell--muted {
    background: linear-gradient(180deg, rgba(251, 252, 255, 0.98) 0%, rgba(246, 248, 252, 0.98) 100%);
}

.templates-builder-shell__section-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.templates-builder-shell__eyebrow {
    margin: 0;
    color: #71809a;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 700;
}

.templates-builder-shell__headline,
.templates-builder-shell__title {
    margin: 0;
    color: #162033;
    font-weight: 700;
    line-height: 1.28;
}

.templates-builder-shell__subtitle,
.templates-builder-shell__supporting-text {
    margin: 0;
    max-width: 68ch;
}

.templates-builder-panel__supporting-text {
    margin: 0;
    max-width: 68ch;
}

.templates-builder-setup__choice-card,
.templates-builder-setup__supported-channel-card,
.templates-builder-content-step__meta-card,
.templates-builder-content-step__delivery-card,
.templates-builder-content-step__channel-choice-card {
    border-radius: 14px;
    border: 1px solid #dce3ef;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
}

.templates-builder-setup__choice-card {
    padding: 14px 16px;
}

.templates-builder-setup__content-type-item {
    display: flex;
}

.templates-builder-setup__content-type-card {
    width: 100%;
    padding: 0;
    border-radius: 16px;
    border: 1px solid #dce3ef;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.templates-builder-setup__content-type-card:hover {
    border-color: #c9d5ea;
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.06);
    transform: translateY(-1px);
}

.templates-builder-setup__content-type-radio {
    display: block;
    width: 100%;
}

.templates-builder-setup__content-type-radio .mud-radio {
    width: 100%;
    margin: 0;
}

.templates-builder-setup__content-type-radio .mud-radio > span:first-child {
    margin-right: 10px;
}

.templates-builder-setup__content-type-radio .mud-radio-label {
    width: 100%;
    margin: 0;
    align-items: center;
    gap: 22px;
    padding: 18px 22px 18px 18px;
}

.templates-builder-setup__content-type-radio .mud-button-root {
    margin-left: 6px;
    margin-right: 12px;
    align-self: center;
    margin-top: 0;
}

.templates-builder-setup__content-type-layout {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 8px 0;
}

.templates-builder-setup__content-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(111, 76, 255, 0.08);
    color: #5b3df5;
    flex-shrink: 0;
}

.templates-builder-setup__content-type-copy {
    min-width: 0;
}

.templates-builder-setup__content-type-title {
    color: #162033;
}

.templates-builder-setup__content-type-helper {
    margin-top: 6px;
    line-height: 1.45;
}

.templates-builder-setup__content-type-item.selected .templates-builder-setup__content-type-card {
    border-color: #6F4CFF;
    box-shadow: 0 0 0 1px rgba(111, 76, 255, 0.2), 0 16px 32px rgba(111, 76, 255, 0.12);
    background: linear-gradient(180deg, rgba(248, 244, 255, 0.98) 0%, rgba(255, 255, 255, 0.99) 100%);
}

.templates-builder-setup__content-type-item.disabled .templates-builder-setup__content-type-card {
    background: linear-gradient(180deg, rgba(249, 250, 252, 0.98) 0%, rgba(244, 246, 250, 0.98) 100%);
    border-color: #e5e9f1;
    box-shadow: none;
}

.templates-builder-setup__supported-channel-card {
    padding: 14px 16px;
}

.templates-builder-setup__supported-channel-avatar {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
    border: 1px solid #e6ebf3;
}

.templates-builder-content-step {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.templates-builder-content-step__hero {
    margin-bottom: 0;
}

.templates-builder-content-step__summary-grid {
    margin-top: 6px;
}

.templates-builder-content-step__meta-card {
    height: 100%;
    padding: 14px 16px;
}

.templates-builder-content-step__meta-label {
    display: block;
    margin-bottom: 6px;
    color: #71809a;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.templates-builder-content-step__meta-value {
    color: #162033;
    font-weight: 600;
    word-break: break-word;
}

.templates-builder-content-step__summary-actions {
    height: 100%;
    justify-content: center;
    width: min(100%, 320px);
    margin-inline: auto;
}

.templates-builder-content-step__summary-actions-shell {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border: 1px solid #dce3ef;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.templates-builder-content-step__delivery-panel .templates-builder-section-panel__body {
    padding-top: 18px;
}

.templates-builder-action-reorder-dialog {
    overflow: hidden;
}

.templates-builder-action-reorder-dialog .mud-dialog {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 960px);
    width: min(92vw, 940px);
}

.templates-builder-action-reorder-dialog .mud-dialog-content {
    padding: 0;
    overflow: auto;
}

.templates-builder-action-reorder-dialog__content {
    padding: 24px 24px 20px;
}

.templates-builder-action-reorder-dialog__intro {
    padding: 16px 18px;
    border: 1px solid #e7ebf3;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(248, 250, 255, 0.96) 0%, rgba(244, 247, 252, 0.9) 100%);
}

.templates-builder-action-reorder-dialog__intro-title {
    margin: 0;
    color: #162033;
    font-weight: 700;
}

.templates-builder-action-reorder-dialog__channel-switcher {
    align-items: stretch;
}

.templates-builder-action-reorder-dialog__active-context {
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding: 0 4px;
}

.templates-builder-action-reorder-dialog__active-context-title {
    display: block;
    margin-bottom: 4px;
    color: #4b5a78;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.templates-builder-action-reorder-dialog__validation {
    position: relative;
    z-index: 0;
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding: 0 4px;
}

.templates-builder-action-reorder-dialog__validation-alert {
    position: relative;
    display: block;
    margin: 0;
}

.templates-builder-action-reorder-dialog__rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
}

.templates-builder-action-reorder-dialog__row {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    transform-origin: center;
    border-color: #d6dfed;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .24s ease, opacity .24s ease;
}

.templates-builder-action-reorder-dialog__row-accent {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, rgba(111, 76, 255, 0.16) 0%, rgba(111, 76, 255, 0.04) 100%);
}

.templates-builder-action-reorder-dialog__row-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 18px;
}

.templates-builder-action-reorder-dialog__row-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.templates-builder-action-reorder-dialog__row-topline-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.templates-builder-action-reorder-dialog__drag-handle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px dashed #d6dfed;
    border-radius: 999px;
    background: #ffffff;
    color: #526077;
    cursor: grab;
    transition: border-color .18s ease, color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.templates-builder-action-reorder-dialog__drag-handle:hover {
    border-color: #b5c3da;
    color: #344054;
    background: #f8faff;
}

.templates-builder-action-reorder-dialog__drag-handle:active {
    cursor: grabbing;
}

.templates-builder-action-reorder-dialog__drag-handle:focus-visible {
    outline: 2px solid #6F4CFF;
    outline-offset: 2px;
}

.templates-builder-action-reorder-dialog__drag-handle-icon {
    color: #6F4CFF;
}

.templates-builder-action-reorder-dialog__drag-handle-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.templates-builder-action-reorder-dialog__position-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f6fc;
    color: #526077;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
}

.templates-builder-action-reorder-dialog__position-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #7b8799;
}

.templates-builder-action-reorder-dialog__position-value {
    color: #1f2937;
}

.templates-builder-action-reorder-dialog__scope-chip {
    font-weight: 600;
}

.templates-builder-action-reorder-dialog__row-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.templates-builder-action-reorder-dialog__row-title {
    margin: 0;
    color: #162033;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.templates-builder-action-reorder-dialog__row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.templates-builder-action-reorder-dialog__type-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7f9fd;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
}

.templates-builder-action-reorder-dialog__type-icon {
    color: #6F4CFF;
}

.templates-builder-action-reorder-dialog__row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #edf1f7;
}

.templates-builder-action-reorder-dialog__drop-zone {
    height: 0;
    display: flex;
    align-items: center;
    padding: 4px 0;
    pointer-events: auto;
    opacity: 0;
    transition: height .18s ease, opacity .18s ease, padding .18s ease;
}

.templates-builder-action-reorder-dialog__drop-zone.is-visible {
    height: 22px;
    padding: 6px 0;
    opacity: .58;
}

.templates-builder-action-reorder-dialog__drop-zone.is-active {
    height: 34px;
    padding: 10px 0;
    opacity: 1;
}

.templates-builder-action-reorder-dialog__drop-indicator {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(111, 76, 255, 0.9) 0%, rgba(111, 76, 255, 0.22) 100%);
    box-shadow: 0 0 0 6px rgba(111, 76, 255, 0.08);
}

.templates-builder-action-reorder-dialog__row.is-highlighted {
    border-color: #6F4CFF;
    box-shadow: 0 0 0 1px rgba(111, 76, 255, 0.22), 0 18px 34px rgba(111, 76, 255, 0.14);
    background: linear-gradient(180deg, rgba(247, 243, 255, 0.98) 0%, rgba(252, 250, 255, 0.98) 100%);
    animation: templates-builder-action-reorder-row-bump .5s cubic-bezier(.16, 1, .3, 1);
}

.templates-builder-action-reorder-dialog__row.is-dragging {
    opacity: .55;
    transform: scale(.985);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.templates-builder-action-reorder-dialog__row.is-dragging .templates-builder-action-reorder-dialog__drag-handle {
    cursor: grabbing;
    border-color: #6F4CFF;
    background: #f7f3ff;
    color: #4d2bf0;
}

.templates-builder-action-reorder-dialog__row.is-highlighted .templates-builder-action-reorder-dialog__row-accent {
    background: linear-gradient(90deg, #6F4CFF 0%, rgba(111, 76, 255, 0.3) 100%);
}

.templates-builder-action-reorder-dialog__position {
    text-transform: uppercase;
    letter-spacing: .06em;
}

.templates-builder-delivery-panel {
    padding: 20px;
}

.templates-builder-delivery-panel__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.templates-builder-delivery-panel__subtitle {
    margin: 0;
    max-width: 70ch;
}

.templates-builder-content-step__delivery-card {
    height: 100%;
}

.templates-builder-content-step__delivery-card--channels {
    padding: 18px;
}

.templates-builder-content-step__channel-choice-card {
    padding: 12px 14px;
}

.templates-builder-content-step__validation-area {
    display: flex;
    flex-direction: column;
}

.templates-builder-content-step__workspace {
    align-items: stretch;
}

.templates-builder-content-step__editor-shell,
.templates-builder-content-step__preview-shell {
    height: 100%;
}

.templates-builder-content-step__editor-head,
.templates-builder-content-step__preview-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.templates-builder-content-step__preview-sticky {
    position: sticky;
    top: 20px;
}

.templates-builder-content-step__preview-shell {
    padding-bottom: 22px;
}

.templates-builder-content-step__mobile-preview-fab-anchor {
    position: fixed;
    inset: auto 16px calc(16px + env(safe-area-inset-bottom)) auto;
    z-index: 1402;
    pointer-events: none;
}

.templates-builder-content-step__mobile-preview-fab {
    position: static;
    background-color: #6F4CFF;
    color: #ffffff;
    pointer-events: auto;
    box-shadow: 0 18px 28px rgba(111, 76, 255, 0.28);
}

.templates-builder-content-step__mobile-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.templates-builder-content-step__mobile-preview-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.templates-builder-content-step__mobile-preview-sheet {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100vw, 420px);
    height: 100vh;
    z-index: 1401;
    overflow: auto;
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    transform: translateX(105%);
    transition: transform .24s ease-out;
}

.templates-builder-content-step__mobile-preview-sheet.is-open {
    transform: translateX(0);
}

.templates-builder-content-step__mobile-preview-content {
    padding: 16px;
}

.templates-builder-action-reorder-dialog .mud-dialog-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    padding: 14px 24px 24px;
    background: #ffffff;
    border-top: 1px solid #e7ebf3;
}

.templates-builder-action-reorder-dialog .mud-dialog-actions > * {
    width: 100%;
}

@keyframes templates-builder-action-reorder-row-bump {
    0% {
        opacity: .7;
        transform: translateY(22px) scale(.975);
        box-shadow: 0 0 0 0 rgba(111, 76, 255, 0), 0 0 0 rgba(111, 76, 255, 0);
    }
    38% {
        opacity: 1;
        transform: translateY(-6px) scale(1.012);
        box-shadow: 0 0 0 1px rgba(111, 76, 255, 0.26), 0 24px 40px rgba(111, 76, 255, 0.18);
    }
    72% {
        opacity: 1;
        transform: translateY(0) scale(1.002);
        box-shadow: 0 0 0 1px rgba(111, 76, 255, 0.24), 0 20px 36px rgba(111, 76, 255, 0.16);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 0 0 1px rgba(111, 76, 255, 0.22), 0 18px 34px rgba(111, 76, 255, 0.14);
    }
}

.form-label::after {
    content: " *";
    color: #dc2626;
}

.form-group:not(:has(.form-input[required])) .form-label::after,
.form-group:has(input[type="url"]:not([required])) .form-label::after,
.form-group:has(input[placeholder*="Etiqueta"]) .form-label::after,
.form-group:has(input[placeholder*="Descripción"]) .form-label::after,
.form-group:has(input[placeholder*="respaldo"]) .form-label::after {
    content: "";
}

.form-input {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    min-height: 40px;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
    border-color: #dc2626;
    background: #fef2f2;
}

.form-input.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.input-counter {
    font-size: 12px;
    color: #6b7280;
    text-align: right;
    margin-top: -2px;
}

.input-helper {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.field-error {
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

.suggestion-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    text-align: center;
    min-height: 70px;
    justify-content: center;
}

.radio-option:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.radio-option.checked {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.radio-option .radio-icon .mud-icon-root {
    font-size: 20px !important;
    transition: color 0.2s ease;
}

.radio-option:not(.checked) .radio-icon .mud-icon-root {
    color: #9ca3af !important;
}

.radio-option.checked .radio-icon .mud-icon-root {
    color: #667eea !important;
}

.radio-text {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.switch-group {
    display: flex;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.switch-option {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
}

.switch-option:last-child {
    border-right: none;
}

.switch-option:hover {
    background: #f9fafb;
}

.switch-option.active {
    background: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .templates-builder-page__card-body {
        padding: 16px;
    }

    .templates-builder-page__navigation > * {
        flex: 0 0 auto;
    }

    .suggestions-editor {
        min-width: 100%;
    }

    .suggestion-card {
        min-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-group.half-width,
    .form-group.third-width {
        flex: 1 1 100%;
    }

    .suggestion-types {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .radio-option {
        padding: 8px 4px;
        min-height: 60px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .card-content {
        padding: 16px;
    }

    .templates-builder-shell,
    .templates-builder-delivery-panel {
        padding: 16px;
        border-radius: 16px;
    }

    .templates-builder-shell__section-header,
    .templates-builder-content-step__editor-head,
    .templates-builder-content-step__preview-head,
    .templates-builder-delivery-panel__header {
        margin-bottom: 14px;
    }

    .templates-builder-setup__content-type-layout {
        padding: 6px 0;
    }

    .templates-builder-setup__content-type-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .templates-builder-setup__content-type-radio .mud-radio-label {
        gap: 18px;
        padding: 16px 18px 16px 16px;
    }

    .templates-builder-setup__content-type-radio .mud-button-root {
        margin-left: 4px;
        margin-right: 10px;
        margin-top: 0;
    }

    .templates-builder-setup__choice-card,
    .templates-builder-setup__supported-channel-card,
    .templates-builder-content-step__meta-card,
    .templates-builder-content-step__channel-choice-card {
        padding: 12px 14px;
    }

    .templates-builder-section-panel__header-shell {
        padding: 14px 16px;
    }

    .templates-builder-section-panel__header-rail {
        gap: 8px;
    }

    .templates-builder-section-panel__body {
        padding: 16px;
    }

    .templates-builder-action-reorder-dialog .mud-dialog {
        width: 100vw;
        max-width: 100vw;
        min-height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .templates-builder-action-reorder-dialog__content {
        padding: 16px 16px 12px;
    }

    .templates-builder-action-reorder-dialog__intro {
        padding: 12px 14px;
    }

    .templates-builder-action-reorder-dialog__active-context {
        padding: 0;
    }

    .templates-builder-action-reorder-dialog__rows {
        max-width: none;
    }

    .templates-builder-action-reorder-dialog__row-shell {
        padding: 12px 12px 14px;
        gap: 12px;
    }

    .templates-builder-action-reorder-dialog__row-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .templates-builder-action-reorder-dialog__row-topline-left {
        width: 100%;
        justify-content: space-between;
    }

    .templates-builder-action-reorder-dialog__drag-handle {
        align-self: flex-start;
    }

    .templates-builder-action-reorder-dialog__scope-chip {
        align-self: flex-start;
    }

    .templates-builder-action-reorder-dialog .mud-dialog-actions {
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .templates-builder-content-step__summary-actions {
        justify-content: stretch;
    }

    .templates-builder-content-step__mobile-preview-sheet {
        width: 100vw;
    }

    .templates-builder-content-step__mobile-preview-content {
        padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
    }

}

@media (min-width: 769px) {
    .templates-builder-page__card-body {
        padding: 22px 24px 24px;
    }

    .templates-builder-content-step__summary-actions {
        align-items: stretch;
    }

    .templates-builder-action-reorder-dialog .mud-dialog {
        width: min(90vw, 920px);
    }

    .templates-builder-action-reorder-dialog__row-actions {
        display: none;
    }

    .templates-builder-action-reorder-dialog .mud-dialog-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .templates-builder-action-reorder-dialog .mud-dialog-actions > * {
        width: auto;
    }
}

/*** PlainText Editor.razor ***/
.plain-text-editor {
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: 0.025em;
}

.form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #111827;
    background-color: #ffffff;
    resize: vertical;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    box-sizing: border-box;
}

.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

.form-textarea:hover {
    border-color: #9ca3af;
}

.form-textarea::placeholder {
    color: #6b7280;
}

.form-help {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

.help-text {
    font-size: 0.75rem;
    color: #374151;
    flex: 1;
}

.character-count {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
}

.character-count.over-limit {
    color: #ef4444;
    font-weight: 600;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    background-color: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
}

.info-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.info-content {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .form-textarea {
        min-height: 100px;
        font-size: 0.8rem;
    }

    .info-card {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/*** CarouselEditor.razor ***/
.card-suggestions-wrapper .suggestions-editor {
    min-width: 100% !important;
    width: 100%;
}

.card-suggestions-wrapper .suggestion-card {
    min-width: 100% !important;
    width: 100%;
}

.card-suggestions-wrapper .form-row {
    flex-wrap: wrap;
}

.card-suggestions-wrapper .form-group.half-width {
    flex: 1 1 100%;
    min-width: 0;
}

.card-suggestions-wrapper .suggestion-types {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.card-suggestions-wrapper .radio-option {
    padding: 8px 4px;
    min-height: 60px;
}

/* Base Carousel Editor Styles */
.carousel-editor {
    width: 100%;
    min-width: 800px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    background: white;
    overflow: hidden;
}

.editor-container {
    padding: 2rem;
    width: 100%;
    min-width: 800px;
    margin: 0 auto;
}

/* Config Section Styles */
.config-section {
    width: 100%;
    min-width: 800px;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-title h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Form Grid Styles */
.form-grid {
    display: grid;
    gap: 1.5rem;
}

.layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fafbfc;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.5;
}

.input-counter {
    align-self: flex-end;
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-error::before {
    content: "⚠️";
    font-size: 1rem;
}

/* Radio and Select Groups */
.radio-group,
.select-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.radio-option,
.select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 100px;
    justify-content: center;
}

.radio-option:hover,
.select-option:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
}

.radio-option.active,
.select-option.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-icon,
.select-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.radio-text,
.select-text {
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Button Styles */
.add-card-btn,
.add-suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.add-card-btn:hover,
.add-suggestion-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.add-card-btn.disabled,
.add-suggestion-btn.disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Empty States */
.empty-state,
.empty-suggestions {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p,
.empty-suggestions p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Cards Container */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Card Editor Styles */
.card-editor {
    background: #fafbfc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card-editor:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.card-info h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.control-btn:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
}

.control-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.control-btn.delete {
    border-color: #fecaca;
    color: #ef4444;
}

.control-btn.delete:hover {
    border-color: #f87171;
    background: #fef2f2;
}

/* Card Sections */
.card-content-section,
.card-layout-section,
.card-suggestions-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.card-content-section:last-child,
.card-layout-section:last-child,
.card-suggestions-section:last-child {
    margin-bottom: 0;
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.subsection-title h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.subsection-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.image-preview img {
    max-width: 350px;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    /*box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);*/
    border: 3px solid #f1f5f9;
}

/* Suggestions Specific Styles */
.suggestions-controls {
    margin-bottom: 1rem;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.suggestion-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.suggestion-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: #e2e8f0;
    color: #64748b;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.75rem;
}

.remove-suggestion-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-suggestion-btn:hover {
    background: #fee2e2;
}

.suggestion-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel-editor {
        min-width: auto;
    }

    .editor-container {
        padding: 1.5rem;
        min-width: auto;
    }

    .config-section {
        padding: 1.5rem;
        min-width: auto;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .suggestion-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .editor-container {
        padding: 1rem;
    }

    .config-section {
        padding: 1rem;
    }

    .card-editor {
        padding: 1rem;
    }

    .card-content-section,
    .card-layout-section,
    .card-suggestions-section {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .card-controls {
        align-self: flex-end;
    }

    .radio-group,
    .select-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .radio-option,
    .select-option {
        justify-content: flex-start;
        min-width: auto;
    }

    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*** RichCardEditor.razor ***/
.standalone-editor {
    width: 100%;
    min-width: 700px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    background: white;
    overflow: hidden;
}

.editor-container {
    padding: 2rem;
    width: 100%;
    min-width: 700px;
    margin: 0 auto;
}

.config-section {
    width: 100%;
    min-width: 700px;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.section-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.section-title h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
    flex: 1;
}

.form-grid {
    display: grid;
    gap: 1.5rem;
}

.layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Disabled form group styles */
.form-group.disabled-group {
    opacity: 0.6;
    pointer-events: none;
}

.form-group.disabled-group .form-label {
    color: #9ca3af;
}

.form-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.disabled-hint {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    font-style: italic;
}

.required {
    color: #ef4444;
    font-weight: 700;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fafbfc;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

.input-counter {
    align-self: flex-end;
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-error::before {
    content: "⚠️";
    font-size: 1rem;
}

/* Radio and Select Groups */
.radio-group,
.select-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.radio-option,
.select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 100px;
    justify-content: center;
}

.radio-option:hover,
.select-option:hover {
    border-color: #c7d2fe;
    background: #f0f4ff;
}

.radio-option.active,
.select-option.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.radio-option.disabled,
.select-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f9fafb;
}

.radio-option.disabled:hover,
.select-option.disabled:hover {
    border-color: #e5e7eb;
    background: #f9fafb;
}

.radio-option:focus,
.select-option:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-icon,
.select-icon {
    font-size: 1.125rem;
    line-height: 1;
}

.radio-text,
.select-text {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.image-preview {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.image-preview img {
    max-width: 350px;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    /*box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);*/
    border: 3px solid #f1f5f9;
}

/* Responsive */
@media (max-width: 768px) {
    .standalone-editor {
        min-width: auto;
    }

    .editor-container {
        padding: 1rem;
        min-width: auto;
    }

    .config-section {
        padding: 1.5rem;
        min-width: auto;
    }

    .layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .radio-group,
    .select-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .radio-option,
    .select-option {
        justify-content: flex-start;
        min-width: auto;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*** OnlyImageEditor.razor ***/
.image-editor-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* ---- INPUT ---- */
.image-editor-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #333;
}

.image-editor-input-wrapper {
    position: relative;
}

.image-editor-url-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid #ccc;
    border-radius: 12px;
    background: #fff;
    color: #333;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.image-editor-url-input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 4px rgba(0,212,170,0.15);
}

.image-editor-input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.image-editor-svg-icon {
    fill: #555;
}

.image-editor-svg-icon-muted {
    fill: #aaa;
    opacity: 0.3;
}

/* ---- TOGGLE ---- */
.image-editor-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 16px;
    border: 1px solid #ddd;
}

.image-editor-toggle-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
    cursor: pointer;
}

.image-editor-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.image-editor-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc; /* gris cuando está apagado */
    border-radius: 32px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-editor-slider:before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.image-editor-toggle-switch input:checked + .image-editor-slider {
    background: #00d4aa;
}

.image-editor-toggle-switch input:checked + .image-editor-slider:before {
    transform: translateX(32px);
}

.image-editor-slider-text {
    color: #333;
    font-size: 0.6rem;
    font-weight: 700;
}

.preview-container {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 2rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.image-preview {
    position: relative;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
    /*box-shadow: 0 8px 32px rgba(0,0,0,0.3);*/
}

.preview-section {
    position: relative;
    z-index: 2;
}

.preview-img {
    max-width: 350px;
    max-height: 250px;
    width: auto;
    height: auto;
    border-radius: 12px;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-info {
    color: white;
}

.url-display {
    font-size: 0.75rem;
    opacity: 0.9;
    word-break: break-all;
}

.pdf-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.pdf-details h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.file-name {
    font-size: 0.875rem;
    opacity: 0.8;
    word-break: break-all;
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state h4 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    opacity: 0.8;
}

.empty-state p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .image-editor-container {
        padding: 1.5rem;
    }

    .toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.dynamic-var-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.image-editor-url-input:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Templates Builder Pill Tabs */
.templates-builder-pill-tabs-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e5ebf5;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(245, 248, 253, 0.98) 100%);
}

.templates-builder-pill-tabs-shell--actions {
    margin-top: 2px;
}

.templates-builder-pill-tabs-shell--button-items,
.templates-builder-pill-tabs-shell--cards {
    padding: 12px;
    background: linear-gradient(180deg, rgba(251, 252, 255, 0.98) 0%, rgba(247, 249, 253, 0.98) 100%);
}

.templates-builder-pill-tabs-shell--screens {
    padding: 12px;
    gap: 12px;
    border-color: #dbe4f2;
    background:
        radial-gradient(circle at top right, rgba(111, 76, 255, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(252, 253, 255, 0.99) 0%, rgba(246, 249, 254, 0.98) 100%);
}

.templates-builder-pill-tabs-shell--cards {
    position: relative;
    gap: 16px;
    border-color: #dbe4f2;
    background:
        radial-gradient(circle at top right, rgba(111, 76, 255, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(252, 253, 255, 0.99) 0%, rgba(246, 249, 254, 0.98) 100%);
}

.templates-builder-pill-tabs__context {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.templates-builder-pill-tabs__context--compact {
    gap: 0;
}

.templates-builder-pill-tabs__eyebrow {
    color: #6a7690;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.templates-builder-pill-tabs__supporting-text {
    margin: 0;
    color: #5f6f8c;
    line-height: 1.45;
}

.templates-builder-pill-tabs {
    overflow: visible;
}

.templates-builder-pill-tabs .mud-tabs-toolbar {
    min-height: auto;
    overflow: visible;
}

.templates-builder-pill-tabs .mud-tabs-tabbar {
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    padding: 4px 4px 7px 4px;
    border: 1px solid #e3e8f3;
    border-radius: 16px;
    background: rgba(240, 244, 251, 0.9);
    overflow: visible !important;
}

.templates-builder-pill-tabs .mud-tabs-tabbar-wrapper {
    overflow: visible !important;
}

.templates-builder-pill-tabs .mud-tabs-tabbar-content {
    overflow-x: scroll !important;
    overflow-y: hidden;
    transform: none !important;
    scrollbar-width: thin !important;
    scrollbar-color: #4f2af0 rgba(79, 42, 240, 0.12) !important;
    padding-bottom: 4px;
    scroll-behavior: smooth;
}

.templates-builder-pill-tabs .mud-tabs-scroll-button {
    display: none !important;
}

.templates-builder-pill-tabs .mud-tab {
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #55637f;
    font-weight: 700;
    letter-spacing: .02em;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.templates-builder-pill-tabs .mud-tab:hover {
    background: rgba(255, 255, 255, 0.68);
    color: #263247;
}

.templates-builder-pill-tabs .mud-tab.mud-tab-active {
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border-color: #d9e2f1;
    color: #4f2af0;
    box-shadow: 0 10px 18px rgba(111, 76, 255, 0.12);
    transform: translateY(-1px);
}

.templates-builder-pill-tabs .mud-tabs-slider {
    display: none;
}

.templates-builder-pill-tabs .mud-tabs-panels {
    padding-top: 16px;
}

.templates-builder-pill-tabs--cards .mud-tab.mud-tab-active {
    background: linear-gradient(180deg, rgba(247, 243, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
}

.templates-builder-pill-tabs--cards .mud-tabs-tabbar {
    padding: 6px 6px 9px 6px;
    border-color: #d8e1f1;
    background: linear-gradient(180deg, rgba(236, 242, 250, 0.94) 0%, rgba(242, 246, 252, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.templates-builder-pill-tabs--cards .mud-tab {
    min-height: 46px;
    color: #43506a;
}

.templates-builder-pill-tabs--cards .mud-tab.mud-tab-active {
    border-color: rgba(111, 76, 255, 0.22);
    color: #4522e6;
    box-shadow: 0 12px 22px rgba(91, 61, 245, 0.14);
}

.templates-builder-pill-tabs--screens .mud-tabs-tabbar {
    padding: 5px 5px 8px 5px;
    border-color: #d8e1f1;
    background: linear-gradient(180deg, rgba(238, 243, 251, 0.94) 0%, rgba(244, 247, 252, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.templates-builder-pill-tabs--screens .mud-tab {
    min-height: 44px;
    padding: 8px 12px;
    color: #43506a;
}

.templates-builder-pill-tabs--screens .mud-tab.mud-tab-active {
    background: linear-gradient(180deg, rgba(247, 243, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
    border-color: rgba(111, 76, 255, 0.22);
    color: #4522e6;
    box-shadow: 0 12px 22px rgba(91, 61, 245, 0.14);
}

.templates-builder-pill-tabs-shell--fields {
    padding: 12px;
    gap: 12px;
    border-color: #dbe4f2;
    background:
        radial-gradient(circle at top right, rgba(111, 76, 255, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(252, 253, 255, 0.99) 0%, rgba(246, 249, 254, 0.98) 100%);
}

.templates-builder-pill-tabs--fields .mud-tabs-tabbar {
    padding: 5px 5px 8px 5px;
    border-color: #d8e1f1;
    background: linear-gradient(180deg, rgba(238, 243, 251, 0.94) 0%, rgba(244, 247, 252, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.templates-builder-pill-tabs--fields .mud-tab {
    min-height: 44px;
    padding: 8px 12px;
    color: #43506a;
}

.templates-builder-pill-tabs--fields .mud-tab.mud-tab-active {
    background: linear-gradient(180deg, rgba(247, 243, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
    border-color: rgba(111, 76, 255, 0.22);
    color: #4522e6;
    box-shadow: 0 12px 22px rgba(91, 61, 245, 0.14);
}

.flow-screens-editor__tab-content {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.flow-screens-editor__tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flow-screens-editor__tab-delete {
    flex-shrink: 0;
}

.templates-builder-actions__helper-text {
    color: #61708d;
}

.templates-builder-actions__cta-shell {
    padding-top: 14px;
    border-top: 1px solid #edf1f7;
}

.templates-builder-actions__cta-button {
    margin-top: 0 !important;
}

.templates-builder-carousel__channel-note {
    margin-bottom: 0;
    border-radius: 14px;
    border-color: rgba(111, 76, 255, 0.38);
    background: linear-gradient(180deg, rgba(249, 246, 255, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.templates-builder-carousel__active-card-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 15px;
    border: 1px solid rgba(111, 76, 255, 0.16);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(248, 244, 255, 0.96) 0%, rgba(255, 255, 255, 0.98) 72%);
    box-shadow: 0 10px 22px rgba(91, 61, 245, 0.06);
}

.templates-builder-carousel__active-card-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(91, 61, 245, 0.1);
    color: #4f2af0;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .02em;
    white-space: nowrap;
}

.templates-builder-carousel__active-card-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.templates-builder-carousel__active-card-title {
    color: #162033;
    font-weight: 700;
}

.templates-builder-carousel__active-card-helper {
    margin: 0;
    color: #5e6d88;
    line-height: 1.45;
}

.templates-builder-phone-field__meta {
    margin-top: -2px;
    color: #64748b;
    line-height: 1.5;
}

/* Templates Builder Edit Modal */
.templates-builder-content-step__edit-dialog .mud-dialog-title,
.templates-builder-content-step__edit-dialog .mud-dialog-content,
.templates-builder-content-step__edit-dialog .mud-dialog-actions {
    padding: 0;
}

.templates-builder-content-step__edit-dialog-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 24px 24px 18px;
    border-bottom: 1px solid #e8edf6;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(245, 248, 253, 0.98) 100%);
}

.templates-builder-content-step__edit-dialog-eyebrow {
    color: #66728a;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.templates-builder-content-step__edit-dialog-title {
    color: #162033;
    font-weight: 700;
}

.templates-builder-content-step__edit-dialog-body {
    padding: 22px 24px 24px;
    background: #ffffff;
}

.templates-builder-content-step__edit-dialog-intro {
    padding: 14px 16px;
    border: 1px solid #e7ebf3;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.92) 0%, rgba(246, 248, 252, 0.96) 100%);
}

.templates-builder-content-step__edit-dialog-form {
    padding: 18px;
    border: 1px solid #dce4f1;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(250, 251, 254, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.templates-builder-content-step__edit-dialog-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: 100%;
    padding: 16px 24px 24px;
    border-top: 1px solid #e8edf6;
    background: linear-gradient(180deg, rgba(250, 252, 255, 0.96) 0%, rgba(246, 248, 252, 0.98) 100%);
}

.templates-builder-content-step__edit-dialog-actions > * {
    width: 100%;
}

@media (max-width: 768px) {
    .templates-builder-pill-tabs-shell {
        padding: 12px;
        gap: 12px;
    }

    .templates-builder-pill-tabs .mud-tab {
        min-height: 40px;
        padding: 9px 12px;
        font-size: .92rem;
    }

    .templates-builder-pill-tabs .mud-tabs-panels {
        padding-top: 14px;
    }

    .templates-builder-carousel__active-card-panel {
        padding: 12px 13px;
    }

    .templates-builder-content-step__edit-dialog-header {
        padding: 18px 18px 14px;
    }

    .templates-builder-content-step__edit-dialog-body {
        padding: 16px 18px 18px;
    }

    .templates-builder-content-step__edit-dialog-form {
        padding: 14px;
    }

    .templates-builder-content-step__edit-dialog-actions {
        padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 769px) {
    .templates-builder-carousel__active-card-panel {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 18px;
    }

    .templates-builder-carousel__active-card-copy {
        flex: 1 1 auto;
        min-width: 0;
    }

    .templates-builder-content-step__edit-dialog-actions {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .templates-builder-content-step__edit-dialog-actions > * {
        width: auto;
    }
}
