/* Explain: Styling for AI tools, including tabs, panels, voice recorder, and results. */
/* ===== أدوات الذكاء الاصطناعي: التبويبات، اللوحات، مسجّل الصوت، والنتائج ===== */

.ai-tabs-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

@media (min-width: 640px) {
    .ai-tabs-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .ai-tabs-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* عند الاستدعاء بالتمرير لا يختفي الشريط خلف الهيدر الثابت */
#ai-tool-tabs {
    scroll-margin-top: 6.5rem;
}

.ai-tab {
    display: inline-flex;
    width: 100%;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.45rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--graphite-deep);
    background: transparent;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.45;
    text-align: center;
    overflow-wrap: break-word;
    cursor: pointer;
    transition: background 240ms ease, color 240ms ease, border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

@media (min-width: 640px) {
    .ai-tab {
        gap: 0.55rem;
        padding: 0.55rem 0.9rem;
        font-size: 0.92rem;
        line-height: 1.5;
    }
}

.ai-tab i {
    font-size: 1rem;
}

.ai-tab:hover {
    background: rgba(43, 48, 55, 0.06);
}

.ai-tab.is-active {
    border-color: var(--accent-border);
    color: var(--accent-color);
    background: rgba(196, 31, 85, 0.08);
    box-shadow: 0 0 0 2px rgba(196, 31, 85, 0.1), 0 10px 24px rgba(196, 31, 85, 0.12);
}

.ai-tab-brand {
    border-color: var(--accent-border);
    color: var(--accent-color);
    background: var(--accent-soft);
}

.ai-tab-brand:hover {
    border-color: var(--accent-color);
    background: rgba(196, 31, 85, 0.14);
}

.ai-tab-label {
    min-width: 0;
}

.ai-tab-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: var(--accent-color);
    background: #ffffff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.7;
}

.ai-panel {
    display: none;
}

.ai-panel.is-active {
    display: block;
    animation: ai-panel-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ai-panel-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-panel.is-active {
        animation: none;
    }
}

/* ===== خطوات التقدّم ===== */

.ai-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ai-step-dot {
    display: grid;
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
}

.ai-step.is-active .ai-step-dot {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.ai-step.is-done .ai-step-dot {
    border-color: var(--accent-color);
    color: #ffffff;
    background: var(--accent-color);
}

.ai-step-label {
    font-weight: 700;
    color: var(--text-muted);
}

.ai-step.is-active .ai-step-label {
    color: var(--accent-color);
}

.ai-step.is-done .ai-step-label {
    color: var(--text-color);
}

/* ===== منطقة رفع الوسائط ===== */

.ai-drop {
    padding: 1.1rem;
    border: 1px dashed var(--primary-border);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
}

.ai-file-card {
    margin-top: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    background: #ffffff;
}

/* ===== مسجّل الصوت ===== */

.ai-rec {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 1.5rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    text-align: center;
}

.ai-rec-btn {
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #d4245c, var(--accent-color));
    font-size: 1.7rem;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(196, 31, 85, 0.32);
    transition: transform 240ms ease, box-shadow 240ms ease;
}

.ai-rec-btn:hover {
    transform: translateY(-2px);
}

.ai-rec.is-recording .ai-rec-btn {
    background: linear-gradient(135deg, #16191d, var(--primary-color));
    animation: ai-rec-pulse 1.5s ease-in-out infinite;
}

.ai-rec-timer {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--graphite-deep);
}

.ai-rec-wave {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 1.9rem;
}

.ai-rec-wave span {
    width: 4px;
    height: 30%;
    border-radius: 999px;
    background: var(--border-color);
}

.ai-rec.is-recording .ai-rec-wave span {
    background: var(--accent-color);
    animation: ai-wave 900ms ease-in-out infinite;
}

.ai-rec-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.ai-rec-wave span:nth-child(3) {
    animation-delay: 0.2s;
}

.ai-rec-wave span:nth-child(4) {
    animation-delay: 0.3s;
}

.ai-rec-wave span:nth-child(5) {
    animation-delay: 0.15s;
}

.ai-rec-wave span:nth-child(6) {
    animation-delay: 0.25s;
}

.ai-rec-wave span:nth-child(7) {
    animation-delay: 0.35s;
}

.ai-rec-hint {
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--text-muted);
}

@keyframes ai-wave {
    0%,
    100% {
        height: 25%;
    }

    50% {
        height: 100%;
    }
}

@keyframes ai-rec-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(196, 31, 85, 0.42);
    }

    50% {
        box-shadow: 0 0 0 16px rgba(196, 31, 85, 0);
    }
}

/* ===== صندوق النص المصدر ===== */

.ai-source {
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f7f7f9;
}

/* ===== تنسيق نص النتائج القادم من الذكاء الاصطناعي ===== */

.ai-prose {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 2.05;
}

.ai-prose h2 {
    margin: 1.4rem 0 0.6rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--graphite-deep);
}

.ai-prose h3 {
    margin: 1.2rem 0 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--accent-color);
}

.ai-prose h2:first-child,
.ai-prose h3:first-child,
.ai-prose p:first-child {
    margin-top: 0;
}

.ai-prose p {
    margin: 0 0 0.85rem;
}

.ai-prose ul {
    margin: 0 0 1rem;
    padding-inline-start: 1.25rem;
    list-style: disc;
}

.ai-prose li {
    margin: 0 0 0.4rem;
}

.ai-prose strong {
    color: var(--graphite-deep);
}

/* ===== بطاقة النتيجة ===== */

.ai-result-card {
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(20, 22, 26, 0.12);
}

.ai-result-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

.ai-result-seal {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    place-items: center;
    border: 2px solid var(--accent-color);
    border-radius: 999px;
    color: var(--accent-color);
    background: var(--accent-soft);
    font-size: 1.3rem;
}

.ai-result-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--graphite-deep);
}

.ai-result-sub {
    margin-top: 0.25rem;
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--text-muted);
}

.ai-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

@media (prefers-reduced-motion: reduce) {
    .ai-tab,
    .ai-rec-btn {
        transition: none;
    }

    .ai-rec.is-recording .ai-rec-btn,
    .ai-rec.is-recording .ai-rec-wave span {
        animation: none;
    }
}

/* ===== بوابة الخدمات المدفوعة: تفعيل الأدوات بعد الشراء ===== */

.ai-gate {
    display: block;
    margin-top: 2.5rem;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse 72% 60% at 50% -12%, rgba(196, 31, 85, 0.1), transparent 70%),
        #ffffff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(20, 22, 26, 0.08);
}

.ai-gate.is-hidden {
    display: none;
}

.ai-gate-lock {
    display: grid;
    width: 3.75rem;
    height: 3.75rem;
    margin: 0 auto;
    place-items: center;
    border: 2px solid var(--accent-color);
    border-radius: 999px;
    color: var(--accent-color);
    background: var(--accent-soft);
    font-size: 1.4rem;
}

.ai-gate-kicker {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--accent-color);
}

.ai-gate-title {
    margin-top: 0.5rem;
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 3vw, 1.7rem);
    font-weight: 800;
    line-height: 1.5;
    color: var(--graphite-deep);
    text-wrap: balance;
}

.ai-gate-text {
    max-width: 36rem;
    margin: 0.65rem auto 0;
    font-size: 0.92rem;
    line-height: 1.95;
    color: var(--text-muted);
    text-wrap: pretty;
}

.ai-gate-price {
    margin-top: 1.1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--graphite-deep);
}

.ai-gate-price .display-font {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
}

.ai-gate-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.ai-gate-actions .btn {
    min-height: 3.25rem;
}

.ai-gate-verify {
    width: 100%;
    max-width: 24rem;
}

.ai-gate-verify-toggle {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.8;
    list-style: none;
}

.ai-gate-verify-toggle::-webkit-details-marker {
    display: none;
}

.ai-gate-verify-toggle::marker {
    content: "";
}

.ai-gate-verify-toggle:hover {
    color: var(--accent-color);
}

.ai-gate-verify-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.ai-gate-verify-status {
    min-height: 1.25rem;
}

/* النموذج يظهر بعد تفعيل الخدمة فقط */
[data-ai-tool-form] {
    display: none;
}

[data-ai-tool-form].is-unlocked {
    display: block;
}

/* ===== بطاقات أسعار خدمات الذكاء الاصطناعي ===== */

.ai-price-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 1.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    text-align: center;
    box-shadow: 0 18px 44px rgba(20, 22, 26, 0.07);
    transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.ai-price-card:hover {
    border-color: var(--accent-border);
    box-shadow: 0 24px 54px rgba(196, 31, 85, 0.14);
    transform: translateY(-4px);
}

.ai-price-icon {
    display: grid;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto;
    place-items: center;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: var(--accent-color);
    background: var(--accent-soft);
    font-size: 1.25rem;
}

.ai-price-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--graphite-deep);
    text-wrap: balance;
}

.ai-price-summary {
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--text-muted);
    text-wrap: pretty;
}

.ai-price-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    margin-top: auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--graphite-deep);
}

.ai-price-value .display-font {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-color);
}

.ai-price-card .btn {
    width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .ai-price-card {
        transition: none;
    }

    .ai-price-card:hover {
        transform: none;
    }
}

/* ===== خطط اشتراك خدمة كلمة العرافة: تجربة لمرة واحدة ومدى الحياة ===== */

.ai-gate-plans {
    display: grid;
    gap: 1rem;
    margin-top: 1.6rem;
}

@media (min-width: 640px) {
    .ai-gate-plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ai-gate-plan {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    text-align: center;
    box-shadow: 0 18px 44px rgba(20, 22, 26, 0.07);
    transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.ai-gate-plan:hover {
    border-color: var(--accent-border);
    box-shadow: 0 24px 54px rgba(196, 31, 85, 0.14);
    transform: translateY(-4px);
}

.ai-gate-plan-badge {
    display: inline-flex;
    align-self: center;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #f7f7f9;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.6;
}

.ai-gate-plan-badge.is-featured {
    border-color: var(--accent-border);
    color: #ffffff;
    background: linear-gradient(135deg, #3a4048, var(--primary-color));
}

.ai-gate-plan-name {
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--graphite-deep);
    text-wrap: balance;
}

.ai-gate-plan-note {
    font-size: 0.85rem;
    line-height: 1.9;
    color: var(--text-muted);
    text-wrap: pretty;
}

.ai-gate-plan .ai-gate-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.35rem;
    margin-top: auto;
}

.ai-gate-plan .btn {
    width: 100%;
    margin-top: 0.4rem;
}

.ai-gate-plan-empty {
    grid-column: 1 / -1;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.9;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .ai-gate-plan {
        transition: none;
    }

    .ai-gate-plan:hover {
        transform: none;
    }
}

/* ===== لوحة نتيجة الترجمة: اللغة الهدف أولاً ثم النص المترجم بخط أوضح ===== */

.ai-trans-target-label {
    margin: 0 0 0.25rem;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.ai-trans-output {
    margin-top: 1.25rem;
    padding: 1.15rem 1.25rem 1.25rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    background:
        radial-gradient(ellipse 72% 60% at 100% 0%, rgba(196, 31, 85, 0.06), transparent 70%),
        #ffffff;
}

.ai-trans-output-title {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--graphite-deep);
}

.ai-trans-output-title i {
    color: var(--accent-color);
}

.ai-trans-text {
    font-size: 1.04rem;
    line-height: 2.15;
}

.ai-trans-text h2,
.ai-trans-text h3 {
    color: var(--graphite-deep);
}

/* أزرار النسخ والتحميل والاستماع في صف واحد واضح */
.ai-trans-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border-color);
}

.ai-trans-actions .btn {
    width: 100%;
    min-height: 3rem;
    padding: 0.5rem 0.6rem;
    justify-content: center;
    font-size: 0.82rem;
    line-height: 1.45;
}

.ai-trans-actions .btn i {
    font-size: 0.9rem;
}

/* ===== بطاقة الخطأ: رسالة واضحة مع زر إعادة المحاولة ===== */

.ai-result-card-error {
    border-color: rgba(198, 44, 71, 0.4);
}

.ai-result-seal-error {
    border-color: var(--danger-color);
    color: var(--danger-color);
    background: rgba(198, 44, 71, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .ai-trans-actions .btn {
        transition: none;
    }
}

/* ===== لوحة «جرّب بصوتك»: اختيار طريقة الإدخال، حالة التسجيل، وبطاقة التقرير ===== */

.ai-step-heading {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--graphite-deep);
}

.ai-step-sub {
    margin: 0 0 1.1rem;
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--text-muted);
    text-wrap: pretty;
}

.ai-method-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
}

@media (min-width: 640px) {
    .ai-method-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ai-method-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--graphite-deep);
    background: #ffffff;
    text-align: start;
    cursor: pointer;
    transition: border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.ai-method-option:hover {
    border-color: var(--primary-border);
}

.ai-method-option.is-active {
    border-color: var(--accent-color);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-color), 0 12px 28px rgba(196, 31, 85, 0.12);
}

.ai-method-icon {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #f7f7f9;
    font-size: 1rem;
}

.ai-method-option.is-active .ai-method-icon {
    border-color: var(--accent-border);
    color: #ffffff;
    background: linear-gradient(135deg, #3a4048, var(--primary-color));
}

.ai-method-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.15rem;
}

.ai-method-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.5;
}

.ai-method-desc {
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.ai-method-panels {
    margin-top: 1rem;
}

.ai-method-panel {
    display: none;
}

.ai-method-panel.is-active {
    display: block;
}

.ai-field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--graphite-deep);
}

.ai-field-hint {
    margin-top: 0.5rem;
    font-size: 0.76rem;
    line-height: 1.75;
    color: var(--text-muted);
}

/* وسم حالة التسجيل: واضح من أول نظرة أعلى الزر */
.ai-rec-state {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #f7f7f9;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.6;
}

.ai-rec-state.is-recording {
    border-color: var(--accent-border);
    color: var(--accent-color);
    background: var(--accent-soft);
}

.ai-rec-state.is-done {
    border-color: rgba(22, 163, 74, 0.4);
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

@media (prefers-reduced-motion: reduce) {
    .ai-method-option {
        transition: none;
    }
}

/* ===== بطاقة تقرير «جرّب بصوتك»: كتل مرتّبة وواضحة على الجوال ===== */

.ai-report-block {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #f7f7f9;
}

.ai-report-block .ai-prose {
    margin-top: 0.35rem;
}

.ai-report-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--graphite-deep);
}

.ai-report-label i {
    color: var(--accent-color);
}

.ai-report-text {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    line-height: 2;
    color: var(--text-color);
    text-wrap: pretty;
}

/* ===== تحليل الأداء: مواصفات المقطع، بطاقة الملف، خطوات بنسب، وتقرير مرتّب ===== */

.ai-specs {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    list-style: none;
}

.ai-specs li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.ai-specs i {
    margin-top: 0.35rem;
    flex-shrink: 0;
    color: var(--accent-color);
    font-size: 0.8rem;
}

.ai-spec-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.ai-spec-label {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.7;
    color: var(--graphite-deep);
}

.ai-spec-value {
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.ai-file-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.ai-file-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: var(--accent-color);
    background: var(--accent-soft);
    font-size: 0.95rem;
}

.ai-file-name {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--graphite-deep);
    overflow-wrap: anywhere;
}

.ai-file-meta {
    margin-top: 0.15rem;
    font-size: 0.78rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.ai-file-remove {
    display: grid;
    width: 2.4rem;
    height: 2.4rem;
    margin-inline-start: auto;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #ffffff;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease;
}

.ai-file-remove.is-off {
    display: none;
}

.ai-file-remove:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.ai-file-state {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.8rem;
    padding: 0.32rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-muted);
    background: #f7f7f9;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.6;
}

.ai-file-state.is-busy {
    border-color: var(--accent-border);
    color: var(--accent-color);
    background: var(--accent-soft);
}

.ai-file-state.is-ok {
    border-color: rgba(22, 163, 74, 0.4);
    color: #16a34a;
    background: rgba(22, 163, 74, 0.08);
}

.ai-file-state.is-error {
    border-color: rgba(198, 44, 71, 0.42);
    color: var(--danger-color);
    background: rgba(198, 44, 71, 0.08);
}

.ai-step-body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1rem;
}

.ai-step-note {
    font-size: 0.72rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.ai-step-pct {
    margin-inline-start: auto;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--text-muted);
}

.ai-step.is-active .ai-step-pct {
    color: var(--accent-color);
}

.ai-step.is-done .ai-step-pct {
    color: #16a34a;
}

.ai-score {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    background:
        radial-gradient(ellipse 78% 62% at 0% 0%, rgba(196, 31, 85, 0.08), transparent 70%),
        #ffffff;
}

.ai-score-value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-shrink: 0;
}

.ai-score-value .display-font {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-color);
}

.ai-score-unit {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.ai-score-body {
    min-width: 0;
    flex: 1;
}

.ai-score-label {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--graphite-deep);
}

.ai-score-track {
    overflow: hidden;
    height: 0.6rem;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: rgba(43, 48, 55, 0.1);
}

.ai-score-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #d4245c, var(--accent-color));
}

.ai-score-note {
    margin-top: 0.55rem;
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--text-muted);
}

@media (min-width: 640px) {
    .ai-score {
        flex-direction: row;
        align-items: center;
        gap: 1.35rem;
    }
}

.ai-report-section {
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-color);
}

.ai-report-section.is-first {
    margin-top: 1.4rem;
    padding-top: 0;
    border-top: 0;
}

.ai-report-heading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.6;
    color: var(--graphite-deep);
}

.ai-report-heading i {
    display: grid;
    width: 1.9rem;
    height: 1.9rem;
    flex-shrink: 0;
    place-items: center;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    color: var(--accent-color);
    background: var(--accent-soft);
    font-size: 0.78rem;
}

.ai-report-section .ai-prose {
    margin-top: 0.7rem;
}

.ai-gate-plans-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 26rem;
    margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
    .ai-file-remove {
        transition: none;
    }
}

/* ===== زر «لديّ موقف آخر أكتبه بنفسي»: مفصول عن القائمة المنسدلة بخط أكبر ===== */

.ai-sit-custom-btn {
    display: inline-flex;
    width: 100%;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-md);
    color: var(--accent-color);
    background: var(--accent-soft);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    text-wrap: balance;
    cursor: pointer;
    transition: background 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.ai-sit-custom-btn i {
    font-size: 1rem;
}

.ai-sit-custom-btn:hover {
    border-color: var(--accent-color);
    background: rgba(196, 31, 85, 0.14);
}

.ai-sit-custom-btn.is-active {
    border-color: var(--accent-color);
    color: #ffffff;
    background: linear-gradient(135deg, #d4245c, var(--accent-color));
    box-shadow: 0 14px 34px rgba(196, 31, 85, 0.32);
}

@media (min-width: 640px) {
    .ai-sit-custom-btn {
        width: auto;
        max-width: 15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-sit-custom-btn {
        transition: none;
    }
}