:root {
    --bg-page: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-muted: #1e293b;
    --border: #334155;
    --border-hover: #475569;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-input: #0f172a;
    --border-input: #334155;
    --bg-chat-user: #1e3a8a;
    --text-chat-user: #eff6ff;
    --bg-chat-ia: #111827;
    --text-chat-ia: #f8fafc;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --bg-card-active: #1e293b;
}

:root[data-theme="light"] {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-muted: #f8fafc;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-input: #ffffff;
    --border-input: #cbd5e1;
    --bg-chat-user: #eff6ff;
    --text-chat-user: #1e3a8a;
    --bg-chat-ia: #ffffff;
    --text-chat-ia: #0f172a;
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.08);
    --bg-card-active: #eff6ff;
}

:root[data-theme="dark"] {
    --bg-page: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1f2937;
    --bg-muted: #1e293b;
    --border: #334155;
    --border-hover: #475569;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bg-input: #0f172a;
    --border-input: #334155;
    --bg-chat-user: #1e3a8a;
    --text-chat-user: #eff6ff;
    --bg-chat-ia: #111827;
    --text-chat-ia: #f8fafc;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --bg-card-active: #1e293b;
}

.ia-page {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}


.ia-hero {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2rem;
    text-align: center;
}

.ia-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--info);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

:root[data-theme="light"] .ia-badge-pill {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
    color: #2563eb;
}

.ia-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: var(--text-main, #ffffff);
}

.ia-hero h1 span {
    background: linear-gradient(135deg, #60a5fa, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ia-lead {
    font-size: 1.15rem;
    color: var(--text-muted, #94a3b8);
    max-width: 780px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.ia-privacy-banner {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-align: left;
    max-width: 820px;
    margin: 0 auto;
    font-size: 0.925rem;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.ia-privacy-banner svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--ok);
    margin-top: 2px;
}


.ia-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem 5rem;
}


.ia-hw-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.ia-hw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #262626);
}

.ia-hw-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.ia-hw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ia-hw-item {
    background: var(--bg-muted, #1c1c1c);
    border: 1px solid var(--border, #2e2e2e);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}

.ia-hw-item-label {
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.ia-hw-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main, #ffffff);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ia-hw-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ia-hw-tag--success {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ia-hw-tag--warning {
    background: var(--warn-bg);
    color: var(--warn);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.ia-hw-tag--info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.ia-hw-rec {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.ia-hw-rec-text {
    font-size: 0.95rem;
    color: var(--text-main, #ffffff);
}

.ia-hw-rec-text strong {
    color: var(--info);
}

:root[data-theme="light"] .ia-hw-rec-text strong {
    color: #2563eb;
}


.ia-model-section {
    margin-bottom: 2rem;
}

.ia-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ia-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ia-model-card {
    background: var(--bg-card, #141414);
    border: 2px solid var(--border, #262626);
    border-radius: 14px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ia-model-card:hover {
    border-color: rgba(96, 165, 250, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ia-model-card.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 1px #3b82f6, 0 8px 25px rgba(37, 99, 235, 0.2);
}

.ia-model-card-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ia-model-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ia-model-desc {
    font-size: 0.875rem;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.ia-model-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.775rem;
    color: var(--text-muted, #94a3b8);
}

.ia-model-meta span {
    background: var(--bg-muted, #1f1f1f);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border, #333333);
}


.ia-model-extra-panel {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ia-model-select-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.ia-select-dropdown {
    flex: 1;
    min-width: 260px;
    background: var(--bg-muted, #1a1a1a);
    color: var(--text-main, #ffffff);
    border: 1px solid var(--border, #333333);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ia-select-dropdown option,
.ia-select-dropdown optgroup {
    background: #1e1e1e;
    color: #ffffff;
}

[data-theme="light"] .ia-select-dropdown {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme="light"] .ia-select-dropdown option,
[data-theme="light"] .ia-select-dropdown optgroup {
    background: #ffffff;
    color: #0f172a;
}

.ia-select-dropdown:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ia-input-text {
    flex: 1;
    min-width: 260px;
    background: var(--bg-muted, #1a1a1a);
    color: var(--text-main, #ffffff);
    border: 1px solid var(--border, #333333);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.ia-input-text:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}



.ia-token-card {
    background: var(--bg-muted);
    border: 1px dashed rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
}

.ia-token-card summary {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--info);
    cursor: pointer;
    user-select: none;
}

.ia-token-body {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ia-token-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.ia-token-hint {
    font-size: 0.825rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.5;
}

.ia-token-hint a {
    color: var(--info);
    text-decoration: underline;
}


.ia-loader-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.ia-progress-container {
    width: 100%;
    max-width: 600px;
    margin: 1.5rem auto 1rem;
}

.ia-progress-bar-bg {
    background: var(--bg-muted, #262626);
    height: 12px;
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.ia-progress-bar-fill {
    background: linear-gradient(90deg, #2563eb, #60a5fa, #10b981);
    height: 100%;
    width: 0%;
    border-radius: 9999px;
    transition: width 0.25s ease-out;
}

.ia-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 0.65rem;
}

.ia-btn-load {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.9rem 2.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.ia-btn-load:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.ia-btn-load:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


.ia-chat-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 3rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    min-height: 580px;
}

.ia-chat-header {
    background: var(--bg-muted, #1a1a1a);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border, #262626);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ia-chat-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.ia-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
}

.ia-status-dot.ready {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.ia-status-dot.busy {
    background: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.ia-chat-metrics {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.825rem;
    color: var(--text-muted, #94a3b8);
}

.ia-metric-pill {
    background: var(--bg-card, #141414);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border, #333333);
}

.ia-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-height: 480px;
}

.ia-empty-chat {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted, #94a3b8);
}

.ia-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ia-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    margin-top: 1.5rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
}

.ia-quick-prompt-btn {
    background: var(--bg-muted, #1f1f1f);
    border: 1px solid var(--border, #333333);
    color: var(--text-main, #f8fafc);
    padding: 0.55rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ia-quick-prompt-btn:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}


.ia-msg {
    display: flex;
    gap: 1rem;
    max-width: 88%;
}

.ia-msg--user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ia-msg--assistant {
    align-self: flex-start;
}

.ia-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ia-msg--user .ia-avatar {
    background: #2563eb;
    color: #ffffff;
}

.ia-msg--assistant .ia-avatar {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #ffffff;
}

.ia-bubble {
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}

.ia-msg--user .ia-bubble {
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.ia-msg--assistant .ia-bubble {
    background: var(--bg-muted, #1e1e1e);
    border: 1px solid var(--border, #2d2d2d);
    color: var(--text-main, #f8fafc);
    border-bottom-left-radius: 4px;
}

.ia-bubble pre {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    position: relative;
}

.ia-bubble code {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
}


.ia-msg-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 100%;
}

.ia-msg-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.ia-msg:hover .ia-msg-actions {
    opacity: 1;
}

.ia-btn-action {
    background: transparent;
    border: 1px solid var(--border, #333333);
    color: var(--text-muted, #94a3b8);
    font-size: 0.775rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.ia-btn-action:hover {
    color: var(--info);
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.ia-btn-action.copied {
    color: var(--ok);
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

.ia-code-copy-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.725rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ia-code-copy-btn:hover {
    color: #ffffff;
    border-color: #60a5fa;
    background: #1e293b;
}

.ia-cursor {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: #3b82f6;
    margin-left: 3px;
    vertical-align: middle;
    animation: blink 0.9s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}


.ia-chat-input-area {
    padding: 1.25rem 1.5rem;
    background: var(--bg-muted, #1a1a1a);
    border-top: 1px solid var(--border, #262626);
}

.ia-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.ia-textarea {
    flex: 1;
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #333333);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    color: var(--text-main, #ffffff);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 52px;
    max-height: 180px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.2s ease;
}

.ia-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ia-btn-send {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ia-btn-send:hover:not(:disabled) {
    background: #1d4ed8;
    transform: scale(1.04);
}

.ia-btn-send:disabled {
    background: var(--border, #333333);
    cursor: not-allowed;
    opacity: 0.6;
}


.ia-btn-stop {
    background: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ia-chat-footer-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
}

.ia-tool-link {
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
}

.ia-tool-link:hover {
    color: var(--info);
}


.ia-edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.ia-edu-card {
    background: var(--bg-card, #141414);
    border: 1px solid var(--border, #262626);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.ia-edu-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.ia-edu-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main, #ffffff);
}

.ia-edu-card p {
    font-size: 0.925rem;
    color: var(--text-muted, #94a3b8);
    line-height: 1.65;
    flex: 1;
}

.ia-edu-card ul {
    margin: 1rem 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted, #94a3b8);
}

.ia-edu-card li {
    margin-bottom: 0.45rem;
}


.ia-compare-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border, #262626);
}

.ia-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.ia-compare-table th,
.ia-compare-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #262626);
}

.ia-compare-table th {
    background: var(--bg-muted, #1a1a1a);
    font-weight: 600;
}

.ia-compare-table tr:last-child td {
    border-bottom: none;
}


.ia-net-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
}

.ia-net-status--online {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--ok);
}

.ia-net-status--offline {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--warn);
}


.ia-autoload-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted, #94a3b8);
}

.ia-autoload-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
}


.ia-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


@media (max-width: 768px) {
    .ia-hero {
        padding: 2rem 1rem 1.5rem;
    }
    .ia-hw-card, .ia-loader-card, .ia-chat-card {
        padding: 1.25rem;
    }
    .ia-msg {
        max-width: 95%;
    }
}


.ia-tabs-container {
    margin-bottom: 2rem;
}

.ia-tabs-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.ia-tabs-nav::-webkit-scrollbar {
    display: none;
}

.ia-tab-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ia-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.ia-tab-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ia-tab-pane {
    display: none;
    animation: iaFadeIn 0.3s ease-out;
}

.ia-tab-pane.active {
    display: block;
}

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


.ia-audio-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 860px) {
    .ia-audio-tool-grid {
        grid-template-columns: 1fr;
    }
}

.ia-audio-input-card, .ia-audio-output-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.ia-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-muted);
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
}

.ia-dropzone:hover, .ia-dropzone.dragover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.ia-dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.ia-record-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.ia-btn-record {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    background: #dc2626;
    color: #ffffff;
}

.ia-btn-record.recording {
    background: #b91c1c;
    animation: iaPulse 1.2s infinite;
}

@keyframes iaPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.03); }
}

.ia-transcription-box {
    flex: 1;
    min-height: 220px;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    margin-bottom: 1rem;
}


.ia-image-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 860px) {
    .ia-image-tool-grid {
        grid-template-columns: 1fr;
    }
}

.ia-image-preview-box {
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.ia-image-preview-box img, .ia-image-preview-box canvas {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}


.ia-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ia-guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
}

.ia-guide-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ia-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 0.75rem;
}

.ia-link-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.hf-quick-pick {
    background: rgba(99, 102, 241, 0.1);
    
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}


.hf-quick-pick:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    transform: translateY(-1px);
}

.ia-hf-guide-card summary {
    font-weight: 600;
    cursor: pointer;
    
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.ia-hf-guide-card summary:hover {
    color: var(--info);
}


.ia-gpu-aviso {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--warn);
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--warn-bg);
    color: var(--text-main);
    font-size: 0.92rem;
    line-height: 1.55;
}

.ia-gpu-aviso__cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--warn);
}

.ia-gpu-aviso__cerrar {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 6px;
}

.ia-gpu-aviso__cerrar:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
}

.ia-gpu-aviso p {
    margin: 0 0 0.6rem;
}

.ia-gpu-aviso ol {
    margin: 0 0 0.4rem;
    padding-left: 1.35rem;
}

.ia-gpu-aviso li {
    margin-bottom: 0.35rem;
}

.ia-gpu-aviso code {
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    font-size: 0.87em;
    
    overflow-wrap: anywhere;
}

.ia-gpu-aviso__detalle {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}


.ia-error-msg {
    color: var(--danger);
    font-weight: 600;
}


.ia-think {
    margin: 0 0 0.75rem;
    border: 1px dashed var(--border);
    border-left: 3px solid var(--info);
    border-radius: 8px;
    background: var(--bg-muted);
    font-size: 0.88rem;
}

.ia-think__cab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 600;
    
    list-style: none;
    user-select: none;
}

.ia-think__cab::-webkit-details-marker { display: none; }

.ia-think__cab::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    color: var(--info);
}

.ia-think[open] > .ia-think__cab::before { transform: rotate(90deg); }

.ia-think__meta {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.75;
}


.ia-think__copiar {
    margin-left: auto;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
}

.ia-think__copiar:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}

.ia-think__cuerpo {
    padding: 0 0.75rem 0.7rem 1.35rem;
    color: var(--text-muted);
    line-height: 1.55;
    
    max-height: 22rem;
    overflow-y: auto;
    overflow-wrap: anywhere;
}


.ia-think__puntos::after {
    content: '…';
    animation: ia-pensando 1.2s steps(4, end) infinite;
}

@keyframes ia-pensando {
    0%   { content: '';    }
    25%  { content: '.';   }
    50%  { content: '..';  }
    75%  { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
    .ia-think__puntos::after { animation: none; content: '…'; }
    .ia-think__cab::before { transition: none; }
}


.ia-think-pref {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.ia-think-pref select {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    padding: 0.15rem 0.35rem;
    font-size: 0.78rem;
}


.ia-quote {
    border-left: 3px solid var(--info);
    padding-left: 0.75rem;
    margin: 0.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.ia-inline-code {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    color: var(--text-main);
    overflow-wrap: anywhere;
}


.ia-cortado {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    padding: 0.4rem 0.6rem;
    border: 1px dashed var(--warn);
    border-radius: 8px;
    background: var(--warn-bg);
    color: var(--warn);
    font-size: 0.82rem;
}
