:root {
    --myragen-bg: #09090f;
    --myragen-panel: #11121a;
    --myragen-surface: #161828;
    --myragen-border: rgba(255, 255, 255, 0.08);
    --myragen-text: #f7f7ff;
    --myragen-muted: #a6a9c9;
    --myragen-purple: #8f5bff;
    --myragen-purple-dark: #5c2dd1;
    --myragen-glow: 0 15px 45px rgba(143, 91, 255, 0.25);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

.myragen-ai-shell {
    background: radial-gradient(circle at top, rgba(143, 91, 255, 0.15), transparent 45%), var(--myragen-bg);
    color: var(--myragen-text);
    border-radius: 28px;
    padding: clamp(1.5rem, 2vw, 2.5rem);
    border: 1px solid var(--myragen-border);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.myragen-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.myragen-ai-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-dot {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--myragen-purple), #c08bff);
    box-shadow: var(--myragen-glow);
}

.brand-label {
    font-weight: 600;
    margin: 0;
}

.brand-sub {
    margin: 0;
    color: var(--myragen-muted);
    font-size: 0.85rem;
}

.myragen-ai-actions {
    display: flex;
    gap: 0.75rem;
}

.myragen-ai-body {
    display: grid;
    grid-template-columns: minmax(260px, 0.3fr) minmax(420px, 0.7fr);
    gap: 1.5rem;
}

.myragen-ai-chat,
.myragen-ai-preview {
    background: var(--myragen-panel);
    border-radius: 24px;
    border: 1px solid var(--myragen-border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.myragen-ai-chat {
    min-height: 520px;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.message {
    padding: 1rem;
    border-radius: 18px;
    background: var(--myragen-surface);
    border: 1px solid var(--myragen-border);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.message.inbound {
    border-left: 3px solid var(--myragen-purple);
}

.message.outbound {
    background: transparent;
    border-style: dashed;
}

.message time {
    font-size: 0.75rem;
    color: var(--myragen-muted);
}

.chat-composer textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--myragen-border);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    color: var(--myragen-text);
    resize: none;
}

.chat-composer textarea:focus {
    outline: 2px solid rgba(143, 91, 255, 0.5);
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

button {
    font: inherit;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.35rem;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

button.primary {
    background: linear-gradient(135deg, var(--myragen-purple), var(--myragen-purple-dark));
    color: white;
    box-shadow: var(--myragen-glow);
}

button.ghost {
    background: transparent;
    border: 1px solid var(--myragen-border);
    color: var(--myragen-muted);
}

button:hover {
    transform: translateY(-1px);
}

.preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.preview-tabs {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.15rem;
    background: rgba(255, 255, 255, 0.04);
}

.preview-tabs button {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    color: var(--myragen-muted);
    background: transparent;
}

.preview-tabs button.active {
    background: var(--myragen-surface);
    color: var(--myragen-text);
}

.preview-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--myragen-muted);
}

.status-pill {
    background: rgba(143, 91, 255, 0.12);
    color: var(--myragen-purple);
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

.preview-surface {
    flex: 1;
    background: linear-gradient(145deg, rgba(16, 16, 26, 0.9), rgba(40, 24, 58, 0.8));
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: clamp(1.2rem, 2vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.hero-text h1 {
    margin-top: 0.2rem;
    margin-bottom: 0.6rem;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.hero-text p {
    color: var(--myragen-muted);
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.hero-media {
    display: grid;
    gap: 1rem;
}

.media-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-card.accent {
    background: rgba(143, 91, 255, 0.22);
}

.metric-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--myragen-muted);
}

.metric-value {
    font-size: 2rem;
    margin: 0.3rem 0;
}

.sparkline {
    display: flex;
    gap: 0.3rem;
    height: 26px;
    align-items: flex-end;
}

.sparkline span {
    display: block;
    flex: 1;
    background: linear-gradient(180deg, var(--myragen-purple), transparent);
    border-radius: 8px 8px 0 0;
    animation: pulse 3s ease-in-out infinite;
}

.sparkline span:nth-child(2) { height: 65%; animation-delay: 0.1s; }
.sparkline span:nth-child(3) { height: 45%; animation-delay: 0.2s; }
.sparkline span:nth-child(4) { height: 80%; animation-delay: 0.3s; }
.sparkline span:nth-child(5) { height: 55%; animation-delay: 0.4s; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.cards-grid article {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 18px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    color: var(--myragen-purple);
    margin-bottom: 0.4rem;
}

.status-label {
    font-size: 0.85rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@media (max-width: 1024px) {
    .myragen-ai-body {
        grid-template-columns: 1fr;
    }

    .myragen-ai-chat,
    .myragen-ai-preview {
        min-height: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
