:root {
    --trrc-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --trrc-primary-color: #3b82f6;
    --trrc-text-color: #1f2937;
    --trrc-text-light: #6b7280;
    --trrc-bg-main: #f9fafb;
    --trrc-bg-card: #ffffff;
    --trrc-border-color: #e5e7eb;
    --trrc-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
    --trrc-transition: all 0.2s ease-in-out;
}

/* === Container === */
.trrc-container {
    font-family: var(--trrc-font-family);
    background: var(--trrc-bg-main);
    border-radius: 6px;
    border: 1px solid var(--trrc-border-color);
    padding: 1px;
}

/* === Nav === */
.trrc-nav {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 8px;
}

.acx-btn {
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 2px 2px;
    border: 1px solid var(--trrc-border-color);
    border-radius: 4px;
    font-size: 10px;
    background: var(--trrc-bg-card);
    color: var(--trrc-text-light);
    cursor: pointer;
}

.acx-btn:hover {
    background: #f3f4f6;
    color: var(--trrc-text-color);
}

/* === Root Grid === */
.acx-root-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2px;
}

/* === Root Card === */
.acx-root-card {
    display: flex;
    flex-direction: column;
    background: var(--trrc-bg-card);
    border: 1px solid var(--trrc-border-color);
    border-radius: 2px;
    padding: 2px;
    box-shadow: var(--trrc-shadow-sm);
    cursor: pointer;
    transition: var(--trrc-transition);
}

.acx-root-card:hover {
    transform: scale(1.01);
    border-color: var(--trrc-primary-color);
}

/* === Header / Body / Footer === */
.acx-fc-header {
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.acx-fc-icon {
    width: 28px;
    height: 28px;
    background: #eff6ff;
    border-radius: 4px;
    display: grid;
    place-items: center;
}

.acx-fc-icon i {
    font-size: 12px;
    color: var(--trrc-primary-color);
}

.acx-fc-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    color: var(--trrc-text-color);
}

/* نسخه پایه (برای سازگاری – بعداً override می‌شود) */
.acx-fc-body {
    margin: 1px 0 0;
    font-size: 0.8rem;
    line-height: 1.25;
    color: var(--trrc-text-light);
    flex-grow: 0;
    padding: 0;
}

.acx-fc-footer {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--trrc-text-light);
    opacity: 0.8;
    padding: 0;
}

/* === Node View === */
.trrc-card {
    background: var(--trrc-bg-card);
    border-radius: 6px;
    border: 1px solid var(--trrc-border-color);
    padding: 2px;
    box-shadow: var(--trrc-shadow-sm);
}

.trrc-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--trrc-text-color);
}

.trrc-description {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--trrc-text-light);
    margin-bottom: 6px;
}

/* === Children Grid === */
.acx-children-grid {
    display: grid;
    gap: 6px;
}

/* === Flashcard Child === */
.acx-child.acx-flashcard {
    display: flex;
    flex-direction: column;
    background: var(--trrc-bg-card);
    border: 1px solid var(--trrc-border-color);
    border-radius: 2px;
    padding: 6px;
    cursor: pointer;
    transition: var(--trrc-transition);
}

.acx-child.acx-flashcard:hover {
    background: #fdfefe;
    border-color: var(--trrc-primary-color);
    transform: scale(1.01);
}

.acx-child.acx-flashcard .acx-fc-header {
    gap: 2px;
    padding: 0;
    margin: 0;
}

.acx-child.acx-flashcard .acx-fc-body {
    margin-top: 2px;
    padding: 0;
    line-height: 1.2;
}

.acx-child.acx-flashcard .acx-fc-footer {
    margin-top: 2px;
    padding: 0;
}

/* === Error === */
.trrc-error {
    color: #ef4444;
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 6px;
    border-radius: 2px;
}

/* ===========================
   TRRC Text Reset (Compact Mode)
   =========================== */

.trrc-container p,
.trrc-container h1,
.trrc-container h2,
.trrc-container h3,
.trrc-container h4,
.trrc-container h5,
.trrc-container h6,
.trrc-container ul,
.trrc-container ol,
.trrc-container li {
    margin: 0 !important;
    padding: 0 !important;
}

.trrc-container p {
    line-height: 1.2;
}

.trrc-container p+p {
    margin-top: 2px !important;
}

.trrc-container ul,
.trrc-container ol {
    list-style-position: inside;
}

.acx-fc-body * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ======================================
   FINAL OVERRIDE: Apply to ALL acx-fc-body
   (Root + Children)  ←  دقیقاً مثل کنسول تو
   ====================================== */

.acx-fc-body {
    padding: 14px 16px !important;
    font-size: 13px !important;
    color: #555 !important;
    min-height: 10px;
    line-height: 1.2;
    margin: 1px 0 0;
}