/* --- ESTILOS GENERALES Y RESETEOS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Usamos system-ui para imitar la tipografía nativa y nítida */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root {
    /* --- PALETA INVERTIDA --- */
    --bg-main: #f5f5f5;
    /* Fondo principal AHORA gris muy claro (Chat) */
    --bg-sidebar: #fcfcfc;
    /* Fondo de la barra lateral AHORA ultra claro */
    --bg-inner-input: #ffffff;
    /* Fondo dentro de la caja de input sigue blanco */

    --text-primary: #1a1a1a;
    /* Texto principal más oscuro para buen contraste */
    --text-secondary: #666666;
    /* Texto secundario gris medio */

    /* Un color de acento más rico para el chat */
    --accent: #00acf6;
    /* Tono azul más oscuro y saturado */
    --accent-green: #1a8754;
    /* Tono verde (para el "Add Name" de tu referencia si lo usas) */

    --border-color: #d8d8d8;
    /* Bordes ligeramente más oscuros para el fondo gris */
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    /* Sombra un poco más definida */
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

body.landing-page {
    min-height: 100vh;
    height: auto;
    overflow: auto;
    background:
        radial-gradient(circle at top left, rgba(0, 172, 246, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(26, 135, 84, 0.14), transparent 24%),
        linear-gradient(135deg, #f8fbfd, #f4f7fb 52%, #eef6f1);
}

.landing-shell {
    width: 100%;
    min-height: 100vh;
    padding: 28px;
}

.landing-stage {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
}

.landing-brand {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.landing-brand img {
    width: 220px;
    max-width: 100%;
    height: auto;
}

.landing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 28px;
    align-items: stretch;
}

.landing-copy,
.landing-panel {
    border-radius: 34px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

.landing-copy {
    padding: 56px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 20%),
        linear-gradient(135deg, #ffffff, #f7fbff 60%, #f2fbf6);
    display: grid;
    align-content: center;
    gap: 22px;
}

.landing-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.landing-eyebrow {
    display: inline-flex;
    width: fit-content;
    min-height: 38px;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-powered-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 700;
}

.landing-headline-block {
    display: grid;
    gap: 10px;
}

.title-container {
    position: relative;
    margin: auto;
    align-items: center;   
    margin-bottom: 30px;
}

.landing-title {
    max-width: 12ch;
    font-weight: 800;
    font-size: clamp(2.9rem, 6vw, 5.5rem);
    text-transform: uppercase;
    line-height: 0.94;
    letter-spacing: -0.06em;

    
}

.landing-kicker {
    font-size: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0ea5e9;
}

.landing-copy h1 {
    max-width: 12ch;
    font-size: clamp(1.9rem, 6vw, 5.5rem);
    line-height: 0.94;
    letter-spacing: -0.06em;
    color: #0b1324;
    text-wrap: balance;
}

.landing-lead {
    max-width: 58ch;
    color: #475569;
    font-size: 1.08rem;
    line-height: 1.8;
}

.landing-cta {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 0 28px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0f172a, #0ea5e9);
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: 0 18px 32px rgba(14, 165, 233, 0.24);
}

.landing-panel {
    padding: 34px 30px;
    background: linear-gradient(180deg, #0f172a, #172554);
    color: #e2e8f0;
    display: grid;
    align-content: start;
    gap: 18px;
}

.landing-panel-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 34px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.landing-panel h2 {
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: #ffffff;
}

.landing-points {
    display: grid;
    gap: 14px;
}

.landing-point {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-point strong {
    display: block;
    margin-bottom: 6px;
    color: #ffffff;
}

.landing-point p {
    color: #cbd5e1;
    line-height: 1.65;
}

/* --- CONTENEDOR PRINCIPAL --- */
.app-container {
    display: flex;
    width: 100%;
}

/* --- BARRA LATERAL (SIDEBAR) --- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    /* Peso fuerte para el logo */
    color: var(--text-primary);
    /* Logo en negro ahora */
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    display: block;
    width: 200px;
    max-width: 100%;    
    height: auto;
}

.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    /* Fondo de búsqueda hereda el gris */
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: #b0b0b0;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 12px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(0, 0, 0, 0.03);
    /* Hover más sutil para fondo ultra claro */
    color: var(--accent);
    font-weight: 600;
    /* Resalta al hover */
}

.nav-icon {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    background-color: var(--text-secondary);
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    background-color: var(--accent);
}

/* Sección de historial simplificada */
.history-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.history-title {
    font-size: 0.8rem;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.history-list {
    list-style: none;
}

.history-item {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 0;
}

.history-item:hover {
    color: var(--accent);
}

.history-item.active {
    color: var(--accent);
    font-weight: 700;
}

.history-item-empty {
    color: #9ca3af;
    cursor: default;
}

/* --- ÁREA DE CONTENIDO PRINCIPAL --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    gap: 24px;
}

/* --- Cabecera Superior --- */
.main-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.user-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-btn {
    background-color: #111111;
    /* Botón negro absoluto, más nítido */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 20px;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #333;
}

.login-btn.is-authenticated {
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
}

.mini-reputation {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-soft);
}

.mini-reputation-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.mini-reputation strong {
    font-size: 1rem;
    color: #111827;
}

.exchange-rate-widget {
    min-width: 270px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-soft);
}

.exchange-rate-label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.exchange-rate-widget strong {
    display: block;
    color: #0f172a;
    font-size: 1.3rem;
}

.exchange-rate-widget small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    line-height: 1.4;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #d0d0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid white;
    /* Un borde para resaltar en el fondo gris */
}

/* --- Contenido Central (Bienvenida) --- */
.welcome-container {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.welcome-container.is-hidden {
    display: none;
}

.floating-orb {
    width: 80px;
    height: 80px;
    /* Un degradado un poco más intenso para el fondo gris */
    background: radial-gradient(circle at 30% 30%, #ecf0ff, #b2bef4);
    border-radius: 50%;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(178, 190, 244, 0.4);
    animation: float 6s ease-in-out infinite;
}

/* Contenedor para el nuevo texto principal */
.greeting-title-wrapper {
    margin-bottom: 20px;
}

/* Aplicamos el peso fuerte de la fuente a todo el mensaje */
.greeting-title,
.greeting-question {
    font-weight: 700;
    letter-spacing: -0.5px;
    /* Ligeramente más juntas las letras, como en la referencia */
}

.greeting-title {
    font-size: 2.8rem;
    /* Aumentado para impacto */
    color: #000000;
    /* El "Hola," en negro, como en tu referencia */
    margin-bottom: 5px;
}

.greeting-question {
    font-size: 1.8rem;
    /* Un poco más pequeño pero igual de fuerte */
    color: var(--accent);
    /* La pregunta en el color de acento */
}

.content-view {
    display: none;
    min-height: 100%;
}

.content-view-active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.marketing-onpage {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 0 12px;
}

.marketing-onpage.is-hidden {
    display: none;
}

.marketing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 28px;
    padding: 42px;
    border-radius: 32px;
    background:
        radial-gradient(circle at top left, rgba(0, 172, 246, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 28%),
        linear-gradient(135deg, #fdfefe, #f2f8ff 52%, #eef6f2);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.marketing-copy {
    display: grid;
    gap: 20px;
    align-content: center;
}

.marketing-eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.marketing-copy h1 {
    max-width: 12ch;
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
    color: #0b1324;
}

.marketing-lead {
    max-width: 58ch;
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.75;
}

.marketing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.marketing-primary-btn,
.marketing-secondary-btn {
    min-height: 54px;
    padding: 0 22px;
    border-radius: 18px;
    font-size: 0.98rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.marketing-primary-btn {
    border: 0;
    background: linear-gradient(135deg, #0f172a, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 16px 28px rgba(14, 165, 233, 0.24);
}

.marketing-secondary-btn {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #0f172a;
}

.marketing-primary-btn:hover,
.marketing-secondary-btn:hover {
    transform: translateY(-1px);
}

.marketing-proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.marketing-proof-item {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.marketing-proof-item strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 0.94rem;
}

.marketing-proof-item span {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.marketing-showcase {
    display: flex;
    align-items: stretch;
}

.marketing-showcase-card {
    width: 100%;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, #0f172a, #172554);
    color: #e2e8f0;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 18px;
}

.marketing-showcase-badge {
    display: inline-flex;
    width: fit-content;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketing-showcase-card h2 {
    font-size: 1.85rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.marketing-showcase-card p {
    color: #cbd5e1;
    line-height: 1.7;
}

.marketing-feature-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.marketing-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #dbeafe;
    line-height: 1.55;
}

.assistant-shell-hidden {
    display: none;
}

.assistant-shell {
    min-height: calc(100vh - 180px);
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 44px;
}

.chat-thread {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 8px;
    padding-bottom: 12px;
}

.chat-message {
    max-width: 82%;
    padding: 14px 16px;
    border-radius: 20px;
    line-height: 1.55;
    font-size: 0.96rem;
    box-shadow: var(--shadow-soft);
}

.chat-message-assistant {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: #1f2937;
}

.chat-message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #ffffff;
}

.chat-message-rich {
    max-width: min(960px, 100%);
}

.chat-rich-layout {
    display: grid;
    gap: 16px;
}

.chat-rich-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.chat-rich-text {
    color: #475569;
    line-height: 1.65;
}

.chat-rich-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.chat-rich-card {
    padding: 14px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-rich-card strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
}

.chat-rich-card span,
.chat-rich-card small {
    display: block;
    color: #64748b;
    line-height: 1.5;
}

.chat-rich-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.76rem;
    font-weight: 800;
}

.chat-rich-table-wrap {
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
}

.chat-rich-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: #ffffff;
}

.chat-rich-table th,
.chat-rich-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.chat-rich-table th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chat-rich-table tr:last-child td {
    border-bottom: 0;
}

.chat-rich-table .chat-provider-actions {
    margin-top: 0;
    min-width: 220px;
}

/* --- Caja de Entrada Inferior --- */
.input-wrapper {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    position: sticky;
    bottom: 0;
    padding-top: 28px;
    background: linear-gradient(180deg, rgba(245, 245, 245, 0), rgba(245, 245, 245, 0.96) 26%, rgba(245, 245, 245, 1) 100%);
}

.chat-input-container {
    background-color: var(--bg-inner-input);
    /* Fondo blanco puro para el input */
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 20px 22px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.search-priority-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.search-priority-card[hidden] {
    display: none;
}

.search-priority-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
}

.search-priority-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.search-priority-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #ffffff;
    cursor: pointer;
}

.search-priority-option input {
    margin-top: 2px;
}

.search-priority-option strong {
    display: block;
    color: #0f172a;
    font-size: 0.9rem;
}

.search-priority-option small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    line-height: 1.45;
}

.search-priority-current {
    color: #0369a1;
    font-size: 0.84rem;
    font-weight: 700;
}

.chat-provider-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chat-provider-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.chat-provider-btn.is-favorite {
    background: #fff7ed;
    color: #c2410c;
}

.chat-provider-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 10px;
    background: #e2e8f0;
}

.chat-provider-reputation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75;
    font-size: 0.78rem;
    font-weight: 800;
}

.chat-text-input {
    width: 100%;
    border: none;
    font-size: 0.98rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    min-height: 58px;
    max-height: 140px;
    line-height: 1.5;
    font-weight: 400;
    /* Peso normal para escribir */
    background: transparent;
}

.chat-text-input::placeholder {
    color: #a0a0a0;
    font-weight: 300;
}

.chat-helper-text {
    color: #6b7280;
    font-size: 0.86rem;
    line-height: 1.5;
}

.chat-attachment-input {
    display: none;
}

.chat-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2937;
    cursor: pointer;
}

/* Panel de botones dentro de la caja de input */
.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.action-buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    background-color: var(--bg-sidebar);
    /* Fondo ultra claro para botones de acción */
    border: 1px solid #e8e8e8;
    min-height: 42px;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: #cccccc;
    color: #333333;
    background-color: #ffffff;
}

.btn-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background-color: var(--text-secondary);
}

.send-btn {
    background: linear-gradient(135deg, #0f172a, #00acf6);
    color: white;
    border: none;
    width: 48px;
    /* Un poco más grande para facilitar el toque */
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background: linear-gradient(135deg, #111827, #0284c7);
}

/* --- MODAL DE AUTENTICACION --- */
.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
}

.auth-modal.is-open {
    display: flex;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(8px);
}

.auth-dialog {
    position: relative;
    width: min(100%, 460px);
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
}

.auth-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    cursor: pointer;
}

.auth-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-switcher {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 6px;
    background: #f3f4f6;
    border-radius: 18px;
}

.auth-switch-btn {
    min-height: 44px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: #4b5563;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
}

.auth-switch-btn.is-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.auth-view {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-view.is-active {
    display: flex;
}

.auth-eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.auth-title {
    font-size: 2rem;
    line-height: 1.1;
    color: #111827;
}

.auth-subtitle {
    color: #6b7280;
    font-size: 0.98rem;
}

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-login-btn,
.primary-auth-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
    font-size: 0.96rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.social-login-btn {
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-login-btn:hover,
.primary-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9ca3af;
    font-size: 0.88rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.email-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.free-badge {
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 172, 246, 0.12);
    color: #0369a1;
    font-size: 0.86rem;
    font-weight: 700;
}

.register-helper {
    color: #6b7280;
    font-size: 0.94rem;
    line-height: 1.5;
}

.auth-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
}

.auth-input {
    width: 100%;
    min-height: 50px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0 16px;
    font-size: 0.96rem;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 172, 246, 0.12);
}

.primary-auth-btn {
    margin-top: 8px;
    border: none;
    background: #111827;
    color: #ffffff;
}

.primary-auth-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.auth-status {
    min-height: 24px;
    font-size: 0.92rem;
    color: #4b5563;
}

.auth-status.is-error {
    color: #dc2626;
}

.auth-status.is-success {
    color: #047857;
}

/* --- CONFIGURACION DE NEGOCIO --- */
.business-view {
    width: 100%;
}

.favorites-view {
    width: 100%;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.business-shell {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
}

.business-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.business-eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.business-title {
    font-size: 2.3rem;
    line-height: 1.05;
    margin-bottom: 10px;
    color: #111827;
}

.business-subtitle {
    max-width: 640px;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

.business-progress-card,
.business-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.business-progress-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #ffffff, #f2fbff);
}

.business-progress-label {
    display: inline-flex;
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 172, 246, 0.12);
    color: #0369a1;
    font-size: 0.8rem;
    font-weight: 700;
}

.business-progress-card strong {
    font-size: 1.05rem;
    color: #111827;
}

.business-progress-card p {
    color: #6b7280;
    line-height: 1.55;
    font-size: 0.94rem;
}

.business-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.business-card {
    padding: 28px;
}

.business-card-header {
    margin-bottom: 20px;
}

.business-card-header h2 {
    font-size: 1.15rem;
    color: #111827;
    margin-bottom: 6px;
}

.business-card-header p {
    color: #6b7280;
    font-size: 0.94rem;
    line-height: 1.5;
}

.business-grid {
    display: grid;
    gap: 16px;
}

.business-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.business-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.business-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.business-field span {
    font-size: 0.92rem;
    font-weight: 600;
    color: #374151;
}

.business-field input,
.business-field select,
.business-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 0.96rem;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.business-field textarea {
    resize: vertical;
    min-height: 112px;
}

.business-field input:focus,
.business-field select:focus,
.business-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 172, 246, 0.12);
}

.business-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.business-note {
    max-width: 560px;
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.55;
}

.business-action-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.business-save-btn {
    min-width: 220px;
}

.business-dashboard-view {
    width: 100%;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-card {
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
}

.dashboard-card-reputation {
    background: linear-gradient(145deg, #0f172a, #111827 46%, #1d4ed8);
    color: #ffffff;
}

.dashboard-card-reputation .dashboard-card-label,
.dashboard-card-reputation .dashboard-card-value,
.dashboard-card-reputation .dashboard-card-meta {
    color: #ffffff;
}

.dashboard-card-label {
    margin-bottom: 10px;
    color: #6b7280;
    font-size: 0.9rem;
}

.dashboard-card-value {
    display: block;
    font-size: 1.9rem;
    line-height: 1;
    color: #111827;
    margin-bottom: 8px;
}

.dashboard-card-meta {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.45;
}

.dashboard-analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-insight {
    padding: 18px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.dashboard-insight-title {
    display: inline-block;
    margin-bottom: 8px;
    color: #111827;
    font-size: 0.92rem;
    font-weight: 700;
}

.dashboard-insight p {
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.55;
}

.dashboard-products-empty {
    min-height: 200px;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 28px;
}

.dashboard-products-empty i {
    font-size: 2rem;
    color: var(--accent);
}

.dashboard-products-empty strong {
    color: #111827;
    font-size: 1.08rem;
}

.dashboard-products-empty p {
    max-width: 520px;
    color: #6b7280;
    line-height: 1.55;
}

.dashboard-product-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-product-option {
    min-height: 180px;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dashboard-product-option:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 172, 246, 0.35);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.dashboard-product-option i {
    font-size: 1.7rem;
    color: var(--accent);
}

.dashboard-product-option strong {
    font-size: 1.04rem;
    color: #111827;
}

.dashboard-product-option span {
    color: #6b7280;
    line-height: 1.55;
    font-size: 0.92rem;
}

.business-note.is-error {
    color: #dc2626;
}

.business-note.is-success {
    color: #047857;
}

.business-checkbox-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.business-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #ffffff;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 600;
}

.business-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.business-chip-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.business-chip-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.business-chip-header span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}

.business-chip-header small {
    color: #6b7280;
    font-size: 0.86rem;
}

.business-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.business-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.business-chip:hover {
    border-color: rgba(0, 172, 246, 0.45);
    transform: translateY(-1px);
}

.business-chip input {
    margin-top: 2px;
    accent-color: var(--accent);
}

.business-chip-text {
    font-size: 0.93rem;
    font-weight: 700;
    color: #111827;
}

.business-chip small {
    display: block;
    margin-left: 28px;
    max-width: 280px;
    color: #6b7280;
    font-size: 0.84rem;
    line-height: 1.45;
}

.danger-btn {
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 16px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.danger-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

@media (max-width: 900px) {
    body {
        height: auto;
        overflow: auto;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        padding: 24px 18px;
    }

    .main-header {
        margin-bottom: 8px;
    }

    .marketing-hero,
    .marketing-proof,
    .business-hero,
    .business-grid-two,
    .business-grid-three,
    .dashboard-grid,
    .dashboard-analytics-grid,
    .dashboard-product-options,
    .business-actions,
    .search-priority-options {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .business-action-group {
        width: 100%;
        flex-direction: column-reverse;
    }

    .business-save-btn,
    .business-action-group .action-btn,
    .business-action-group .danger-btn {
        width: 100%;
    }

    .marketing-hero {
        padding: 26px 22px;
    }

    .marketing-copy h1 {
        max-width: none;
    }

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

    .landing-copy {
        padding: 34px 24px;
    }

    .landing-panel {
        padding: 28px 22px;
    }
}

@media (max-width: 640px) {
    .auth-dialog {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .auth-title {
        font-size: 1.7rem;
    }

    .input-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .marketing-actions {
        flex-direction: column;
    }

    .marketing-primary-btn,
    .marketing-secondary-btn {
        width: 100%;
    }

    .action-buttons-group {
        flex-direction: column;
    }

    .send-btn {
        align-self: flex-end;
    }

    .assistant-shell {
        min-height: auto;
    }

    .chat-message {
        max-width: 100%;
    }

    .input-wrapper {
        position: static;
        padding-top: 0;
        background: transparent;
    }

    .user-toolbar {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .business-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .business-title {
        font-size: 1.9rem;
    }

    .landing-shell {
        padding: 18px;
    }

    .landing-copy,
    .landing-panel {
        border-radius: 26px;
    }

    .landing-cta {
        width: 100%;
    }
}

/* --- ANIMACIONES --- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}
