/* Explain: Styles for UI components including navigation, tool, assistant, and display elements. */
.site-header {
    background: linear-gradient(180deg, rgba(250, 249, 246, 0.9), rgba(250, 249, 246, 0.55));
    backdrop-filter: blur(18px);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--sage-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.section-kicker::before {
    display: inline-block;
    width: 2.4rem;
    height: 1px;
    background: var(--accent-color);
    content: "";
}

.glass-panel {
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(250, 249, 246, 0.8), rgba(255, 255, 255, 0.5));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.arch-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(88, 129, 87, 0.38);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.arch-frame::after {
    position: absolute;
    inset: 1.1rem;
    border: 1px solid rgba(250, 249, 246, 0.6);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.arch-frame-large {
    height: min(72vh, 680px);
    min-height: 460px;
    border-radius: 999px 999px 2.5rem 2.5rem;
}

.floating-note {
    position: absolute;
    inset-inline-end: -1rem;
    bottom: 3rem;
    display: flex;
    max-width: 260px;
    align-items: center;
    gap: 0.85rem;
    border-radius: 999px;
    padding: 1rem 1.2rem;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.6;
}

.form-panel {
    border-radius: 2.2rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.form-label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 700;
}

.form-status.success {
    color: #4A6B53;
}

.form-status.error {
    color: #9B4A3D;
}

.form-status.is-info {
    color: var(--sage-dark);
}

.step-num {
    position: absolute;
    inset-inline-end: 1.6rem;
    top: 1.2rem;
    color: var(--sage-soft);
    font-family: var(--font-heading);
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1.1rem;
    background: var(--sage-soft);
    color: var(--primary-color);
    font-size: 1.3rem;
}

/* Tool */
.mode-tab {
    display: inline-flex;
    flex: 1 1 0%;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    border: 0;
    border-radius: 1rem;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    transition: background 300ms ease, color 300ms ease, box-shadow 300ms ease;
}

.mode-tab:hover {
    color: var(--primary-color);
}

.mode-tab.is-active {
    background: var(--background-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.style-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--field-bg);
    padding: 0.55rem 1.2rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 300ms ease;
}

.style-chip:hover {
    border-color: var(--accent-color);
    color: var(--primary-color);
}

.style-chip.is-active {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--background-color);
    box-shadow: var(--shadow-button);
}

.result-block {
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    background: var(--field-bg);
    padding: 1.4rem;
}

.result-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
}

.proof-text {
    margin-top: 1rem;
    border-radius: 1.2rem;
    background: var(--background-color);
    padding: 1.2rem;
    color: var(--text-color);
    font-size: 1.12rem;
    line-height: 2.2;
    white-space: pre-wrap;
    word-break: break-word;
}

.midad-mark {
    border-radius: 0.4rem;
    background: var(--terracotta-soft);
    color: var(--sage-dark);
    padding: 0.05rem 0.3rem;
    font-weight: 700;
    box-shadow: inset 0 -0.35em 0 rgba(192, 207, 178, 0.55);
}

.correction-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.5rem;
}

.correction-item {
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    background: var(--background-color);
    padding: 1rem 1.1rem;
}

.correction-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.correction-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--background-color);
    font-size: 0.85rem;
    font-weight: 700;
}

.correction-type {
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.25rem 0.85rem;
    color: var(--sage-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.correction-pair {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.8rem;
    font-size: 1.08rem;
}

.correction-wrong {
    color: #9B4A3D;
    text-decoration: line-through;
}

.correction-pair i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.correction-right {
    color: #3A5A40;
    font-weight: 700;
}

.correction-exp {
    margin-top: 0.6rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.95;
}

.empty-note {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    border-radius: 1rem;
    background: var(--sage-soft);
    padding: 0.8rem 1.1rem;
    color: var(--sage-dark);
    font-weight: 600;
}

.para-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.para-card {
    border: 1px solid var(--glass-border);
    border-radius: 1.4rem;
    background: var(--background-color);
    padding: 1.2rem;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.para-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

.para-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.para-badge {
    border-radius: 999px;
    background: var(--primary-color);
    padding: 0.25rem 0.9rem;
    color: var(--background-color);
    font-size: 0.82rem;
    font-weight: 700;
}

.para-text {
    margin-top: 0.9rem;
    color: var(--text-color);
    font-size: 1.08rem;
    line-height: 2.1;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--field-bg);
    padding: 0 1rem;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 300ms ease;
}

.copy-btn:hover {
    border-color: var(--accent-color);
    background: var(--surface-color);
}

.copy-btn.is-copied {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--background-color);
}

.copy-btn.is-recording {
    border-color: var(--danger-color);
    background: rgba(155, 74, 61, 0.12);
    color: var(--danger-color);
}

.voice-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: var(--danger-color);
    animation: voice-pulse 1s ease-in-out infinite;
}

@keyframes voice-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(0.75);
    }
}

/* FAQ */
.faq-item {
    border-radius: 1.4rem;
    padding: 0.35rem 1.4rem;
}

.faq-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.6rem;
    list-style: none;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 700;
}

.faq-summary::-webkit-details-marker {
    display: none;
}

.faq-summary i {
    color: var(--accent-color);
    transition: transform 300ms ease;
}

.faq-item[open] .faq-summary i {
    transform: rotate(180deg);
}

.faq-body {
    padding-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 2.05;
}

.form-label.is-inline {
    margin-bottom: 0;
}

.char-counter.is-warning {
    color: var(--warning-color);
}

.char-counter.is-limit {
    color: var(--danger-color);
    font-weight: 800;
}

.run-spinner {
    display: inline-block;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid rgba(31, 46, 35, 0.25);
    border-top-color: var(--primary-color);
    border-radius: 999px;
    animation: farahidi-spin 700ms linear infinite;
}

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

.history-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.9rem;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    background: var(--field-bg);
    padding: 0.9rem 1.1rem;
    transition: border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.history-restore {
    display: grid;
    flex: 1 1 auto;
    gap: 0.5rem;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: start;
    color: inherit;
    font-family: var(--font-body);
}

.history-delete {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--background-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: all 300ms ease;
}

.history-delete:hover {
    border-color: transparent;
    background: var(--danger-color);
    color: var(--background-color);
}

.history-result {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.2rem 0.75rem;
    color: var(--sage-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.history-item:hover {
    border-color: var(--accent-color);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.history-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.history-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
}

.history-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.history-preview {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.9;
}

.mode-tab:focus-visible,
.style-chip:focus-visible,
.copy-btn:focus-visible,
.history-restore:focus-visible,
.history-delete:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .section-kicker::before {
        width: 1.6rem;
    }

    .arch-frame-large {
        height: 440px;
        min-height: 0;
        margin-right: auto;
        margin-left: auto;
        width: min(100%, 440px);
    }

    .floating-note {
        position: relative;
        inset-inline-end: auto;
        bottom: auto;
        margin: -2.5rem auto 0;
    }
}

.import-bar {
    border: 1px dashed var(--glass-border);
    background: var(--field-bg);
}

.correction-rule {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.6rem;
    border-inline-start: 3px solid var(--accent-color);
    border-radius: 0.7rem;
    background: var(--sage-soft);
    padding: 0.6rem 0.9rem;
    color: var(--sage-dark);
    font-size: 0.9rem;
    line-height: 1.9;
}

.correction-rule i {
    margin-top: 0.4rem;
    color: var(--accent-color);
}

@media (max-width: 640px) {
    .mode-tab {
        min-height: 3.4rem;
        font-size: 1.05rem;
    }

    .style-chip {
        min-height: 2.9rem;
        padding: 0.6rem 1.2rem;
    }
}

/* دليل الأخطاء الشائعة */
.guide-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rule-card {
    transition: border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.rule-card:hover {
    border-color: var(--accent-color);
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.rule-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0 1.1rem;
    color: var(--sage-dark);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 300ms ease;
}

.rule-action:hover {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--background-color);
    box-shadow: var(--shadow-button);
}

.rule-action:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* شريط أقسام دليل الأخطاء */
.guide-nav-wrap {
    position: relative;
}

.guide-subnav {
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(180deg, rgba(250, 249, 246, 0.96), rgba(250, 249, 246, 0.82));
    backdrop-filter: blur(18px);
}

.guide-subnav.is-fixed {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 30;
    box-shadow: var(--shadow-soft);
}

.guide-subnav-inner {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.7rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.guide-subnav-inner::-webkit-scrollbar {
    display: none;
}

.guide-nav-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.7rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--field-bg);
    padding: 0 1.15rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 300ms ease;
}

.guide-nav-link:hover {
    border-color: var(--accent-color);
    color: var(--primary-color);
}

.guide-nav-link.is-active {
    border-color: transparent;
    background: var(--primary-color);
    color: var(--background-color);
    box-shadow: var(--shadow-button);
}

.guide-nav-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.guide-group {
    scroll-margin-top: 9rem;
}

@media (max-width: 640px) {
    .guide-nav-link {
        min-height: 2.9rem;
        font-size: 0.95rem;
    }
}

/* المساعد اللغوي */
.assistant-widget {
    position: fixed;
    inset-inline-end: 1.1rem;
    bottom: 1.1rem;
    z-index: 85;
    font-family: var(--font-body);
}

.assistant-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--primary-color);
    padding: 0 1.3rem;
    color: var(--background-color);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: var(--shadow-button);
    transition: background 300ms ease, color 300ms ease, transform 300ms ease;
}

.assistant-toggle:hover {
    background: var(--primary-hover);
    color: var(--text-color);
    transform: translateY(-2px);
}

.assistant-toggle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.assistant-panel {
    position: fixed;
    inset-inline-end: 1.1rem;
    bottom: 5.6rem;
    z-index: 86;
    display: flex;
    flex-direction: column;
    width: min(24rem, calc(100vw - 2.2rem));
    max-height: min(36rem, calc(100dvh - 8rem));
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.75rem;
    background: var(--background-color);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.98);
    transition: opacity 250ms ease, transform 250ms ease, visibility 250ms ease;
}

.assistant-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.assistant-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--sage-dark));
    color: var(--background-color);
}

.assistant-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(250, 249, 246, 0.2);
    font-size: 1rem;
}

.assistant-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.assistant-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.assistant-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.85;
}

.assistant-head-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.assistant-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: rgba(250, 249, 246, 0.16);
    color: var(--background-color);
    font-size: 0.95rem;
    transition: background 250ms ease;
}

.assistant-icon-btn:hover {
    background: rgba(250, 249, 246, 0.34);
}

.assistant-icon-btn:focus-visible {
    outline: 2px solid var(--background-color);
    outline-offset: 2px;
}

.assistant-messages {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    padding: 1.1rem;
    background: var(--surface-color);
}

.assistant-msg {
    display: flex;
}

.assistant-msg.is-user {
    justify-content: flex-end;
}

.assistant-bubble {
    max-width: 88%;
    border-radius: 1.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.95;
    white-space: pre-wrap;
    word-break: break-word;
}

.assistant-msg:not(.is-user) .assistant-bubble {
    border: 1px solid var(--glass-border);
    border-start-start-radius: 0.35rem;
    background: var(--background-color);
    color: var(--text-color);
}

.assistant-msg.is-user .assistant-bubble {
    border-start-end-radius: 0.35rem;
    background: var(--primary-color);
    color: var(--background-color);
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem 0;
    background: var(--surface-color);
}

.assistant-suggestions.is-empty {
    display: none;
}

.assistant-form {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem 1.1rem;
    background: var(--surface-color);
}

.assistant-input {
    flex: 1 1 auto;
    min-height: 2.9rem;
    max-height: 6rem;
    resize: none;
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    background: var(--field-bg);
    padding: 0.7rem 1rem;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
}

.assistant-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.assistant-input::placeholder {
    color: var(--text-muted);
}

.assistant-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.9rem;
    height: 2.9rem;
    border: 0;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--background-color);
    font-size: 1rem;
    transition: background 250ms ease, color 250ms ease;
}

.assistant-send:hover {
    background: var(--primary-hover);
    color: var(--text-color);
}

.assistant-send:disabled {
    opacity: 0.6;
}

.assistant-fix {
    margin-top: 0.7rem;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: var(--sage-soft);
    padding: 0.75rem 0.85rem;
}

.assistant-fix-pair {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.assistant-fix-wrong {
    color: #9B4A3D;
    text-decoration: line-through;
}

.assistant-fix-right {
    color: #3A5A40;
    font-weight: 700;
}

.assistant-fix-note {
    margin: 0.5rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.85;
}

@media (max-width: 640px) {
    .assistant-toggle-label {
        display: none;
    }

    .assistant-toggle {
        width: 3.5rem;
        height: 3.5rem;
        min-height: 0;
        justify-content: center;
        padding: 0;
        font-size: 1.2rem;
    }

    .assistant-panel {
        inset: 0;
        width: auto;
        max-height: none;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        transform: translateY(100%);
    }

    .assistant-panel.is-open {
        transform: translateY(0);
    }
}

/* سجل العمليات */
.history-clear {
    border-color: rgba(155, 74, 61, 0.4);
    color: var(--danger-color);
}

.history-clear:hover {
    border-color: transparent;
    background: var(--danger-color);
    color: var(--background-color);
}

/* مقارنة النصّين */
.diff-stats {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .diff-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.diff-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border: 1px solid var(--glass-border);
    border-radius: 1.2rem;
    background: var(--background-color);
    padding: 0.9rem 1rem;
}

.diff-stat-num {
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.3;
}

.diff-stat-num.is-del {
    color: var(--danger-color);
}

.diff-stat-num.is-add {
    color: var(--sage-dark);
}

.diff-stat-num.is-rate {
    color: var(--warning-color);
}

.diff-stat-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.diff-stat-num.is-text {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
}

.diff-panel {
    margin-top: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 1.4rem;
    background: var(--background-color);
    padding: 1.1rem 1.2rem;
}

.diff-panel-del {
    border-inline-start: 4px solid var(--danger-color);
}

.diff-panel-add {
    border-inline-start: 4px solid var(--sage-dark);
}

.diff-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.diff-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
}

.diff-text {
    margin: 0.9rem 0 0;
    color: var(--text-color);
    font-size: 1.05rem;
    line-height: 2.15;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-mark-del {
    border-radius: 0.35rem;
    background: rgba(155, 74, 61, 0.16);
    padding: 0.05rem 0.3rem;
    color: var(--danger-color);
    font-weight: 700;
    text-decoration: line-through;
}

.diff-mark-add {
    border-radius: 0.35rem;
    background: rgba(88, 129, 87, 0.2);
    padding: 0.05rem 0.3rem;
    color: var(--sage-dark);
    font-weight: 700;
}

/* محتوى مقالات المدونة */
.post-content {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 2.25;
    word-break: break-word;
}

.post-content p {
    margin: 0 0 1.15rem;
}

.post-content h2 {
    margin: 2rem 0 0.9rem;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.5;
}

.post-content h3 {
    margin: 1.6rem 0 0.7rem;
    color: var(--sage-dark);
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.5;
}

.post-content ul,
.post-content ol {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1.15rem;
    padding-inline-start: 1.5rem;
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    line-height: 2;
}

.post-content strong {
    color: var(--sage-dark);
    font-weight: 700;
}

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* التمارين اللغوية التفاعلية */
.quiz-card {
    border-radius: 1.6rem;
    padding: 1.4rem;
}

.quiz-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.quiz-tag,
.dict-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.25rem 0.85rem;
    color: var(--sage-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.quiz-question {
    margin: 0;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.7;
}

.quiz-options {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 3rem;
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    background: var(--background-color);
    padding: 0.7rem 1.1rem;
    text-align: start;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    transition: all 300ms ease;
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--accent-color);
    background: var(--surface-color);
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option.is-correct {
    border-color: transparent;
    background: var(--sage-soft);
    color: var(--sage-dark);
    font-weight: 700;
}

.quiz-option.is-wrong {
    border-color: transparent;
    background: rgba(155, 74, 61, 0.14);
    color: var(--danger-color);
    font-weight: 700;
    text-decoration: line-through;
}

.quiz-explain {
    margin-top: 1.1rem;
    border-inline-start: 3px solid var(--accent-color);
    border-radius: 0.9rem;
    background: var(--sage-soft);
    padding: 0.85rem 1rem;
    color: var(--sage-dark);
    font-size: 0.95rem;
    line-height: 1.95;
}

/* المعجم اللغوي */
.dict-card {
    border-radius: 1.5rem;
    padding: 1.3rem;
    transition: border-color 300ms ease, box-shadow 300ms ease, background 300ms ease;
}

.dict-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
}

.dict-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.dict-word {
    margin: 0;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.dict-meaning {
    margin: 0.8rem 0 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 2;
}

.dict-example {
    margin: 0.7rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.9;
}

.dict-root {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.9rem;
    border-radius: 999px;
    background: var(--field-bg);
    padding: 0.2rem 0.8rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

/* شعار المنصة */
.logo-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

/* تجربة الجوال: أهداف لمس أكبر، ومنع التكبير التلقائي في حقول الإدخال، وتخفيف التمويه الزائد للأداء */
@media (max-width: 640px) {
    .copy-btn,
    .rule-action,
    .history-delete,
    .assistant-icon-btn {
        min-height: 2.75rem;
    }

    .history-delete,
    .assistant-icon-btn {
        width: 2.75rem;
    }

    input[type="search"],
    input[type="email"],
    input[type="text"],
    input[type="tel"],
    input[type="url"],
    select,
    .assistant-input {
        font-size: 1rem;
    }

    .site-header,
    .glass-panel {
        backdrop-filter: blur(10px);
    }
}