/* TeleLive — Rules page (readable bilingual document) */
.tl-rules-surface {
    --tl-r-max: 920px;
    --tl-r-accent: #3b82f6;
    --tl-r-fa: "Vazirmatn", "Dana", Tahoma, sans-serif;
    --tl-r-en: "Segoe UI", system-ui, -apple-system, sans-serif;
    min-height: 70vh;
    padding: 0 0 4rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(30, 86, 245, 0.12), transparent 60%),
        var(--bg);
}

.tl-rules-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.5rem clamp(14px, 3vw, 24px) 0;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

@media (max-width: 960px) {
    .tl-rules-wrap { grid-template-columns: 1fr; gap: 1.25rem; }
}

.tl-rules-sidebar { position: sticky; top: 80px; }
@media (max-width: 960px) { .tl-rules-sidebar { position: static; } }

.tl-rules-toc {
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: var(--shadow);
}

.tl-rules-toc h4 {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.tl-rules-toc a {
    display: block;
    padding: 9px 11px;
    margin-bottom: 4px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg-elev-2);
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.tl-rules-toc a:hover,
.tl-rules-toc a:focus-visible {
    border-color: rgba(59, 130, 246, 0.45);
    background: var(--bg-elev-3);
    outline: none;
}

.tl-rules-toc a .toc-fa {
    display: block;
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
    font-weight: 600;
}

.tl-rules-toc a .toc-en {
    display: block;
    margin-top: 2px;
    font-family: var(--tl-r-en);
    font-size: 0.75rem;
    color: var(--text-muted);
    direction: ltr;
}

.tl-rules-main { min-width: 0; max-width: var(--tl-r-max); }

/* Hero */
.tl-rules-hero {
    background: linear-gradient(145deg, var(--bg-elev-1), var(--bg-elev-2));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.tl-rules-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.tl-rules-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text-muted);
}

.tl-rules-hero-title-fa {
    margin: 0 0 10px;
    font-family: var(--tl-r-fa);
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    font-weight: 800;
    line-height: 1.55;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-hero-title-en {
    margin: 0 0 14px;
    font-family: var(--tl-r-en);
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-muted);
}

.tl-rules-hero-lead-fa {
    margin: 0 0 10px;
    font-family: var(--tl-r-fa);
    font-size: 1.02rem;
    line-height: 1.85;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-hero-lead-en {
    margin: 0;
    font-family: var(--tl-r-en);
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

/* Sections */
.tl-rules-section {
    margin-bottom: 2.25rem;
    scroll-margin-top: 88px;
}

.tl-rules-section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 1rem;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.25);
}

.tl-rules-section-num {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--tl-r-accent);
    font-family: var(--tl-r-en);
    font-size: 0.85rem;
    font-weight: 800;
}

.tl-rules-section-titles { flex: 1; min-width: 0; }

.tl-rules-section-titles h2 {
    margin: 0;
    font-family: var(--tl-r-fa);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.55;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-section-titles .sub-en {
    display: block;
    margin-top: 4px;
    font-family: var(--tl-r-en);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    direction: ltr;
    text-align: left;
}

/* Rule items — FA first (readable), EN below */
.tl-rules-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tl-rules-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--bg-elev-1);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.tl-rules-item-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--tl-r-accent);
    font-size: 0.95rem;
}

.tl-rules-item-body { flex: 1; min-width: 0; }

.tl-rules-item-body h3 {
    margin: 0 0 8px;
    font-family: var(--tl-r-fa);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.65;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-item-body .txt-fa {
    margin: 0 0 12px;
    font-family: var(--tl-r-fa);
    font-size: 0.95rem;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
    color: var(--text);
}

.tl-rules-item-body .txt-en {
    margin: 0;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-family: var(--tl-r-en);
    font-size: 0.86rem;
    line-height: 1.75;
    direction: ltr;
    text-align: left;
    color: var(--text-muted);
}

.tl-rules-item-body .txt-en strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

/* Tables */
.tl-rules-prose {
    margin: 0 0 14px;
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.tl-rules-prose.fa {
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
    line-height: 1.9;
}

.tl-rules-prose.en {
    font-family: var(--tl-r-en);
    direction: ltr;
    text-align: left;
    margin-bottom: 8px;
}

.tl-rules-table-wrap {
    border-radius: 14px;
    border: 1px solid var(--line);
    overflow: auto;
    margin-bottom: 16px;
    background: var(--bg-elev-1);
    -webkit-overflow-scrolling: touch;
}

.tl-rules-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tl-rules-table th,
.tl-rules-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.6;
}

.tl-rules-table thead th {
    background: var(--bg-elev-2);
    font-weight: 700;
    font-size: 0.8rem;
    text-align: start;
}

.tl-rules-table tbody tr:last-child td { border-bottom: none; }
.tl-rules-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }

.tl-rules-table .col-en { font-family: var(--tl-r-en); direction: ltr; }
.tl-rules-table .col-fa {
    font-family: var(--tl-r-fa);
    direction: rtl;
    text-align: right;
}

.tl-rules-alert {
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.08);
    padding: 16px 18px;
}

.tl-rules-alert p {
    margin: 0 0 10px;
    font-size: 0.94rem;
    line-height: 1.75;
    color: var(--text);
}

.tl-rules-alert p:last-child { margin-bottom: 0; }
.tl-rules-alert .fa { font-family: var(--tl-r-fa); direction: rtl; text-align: right; line-height: 1.9; }
.tl-rules-alert .en { font-family: var(--tl-r-en); direction: ltr; text-align: left; color: var(--text-muted); font-size: 0.88rem; }

.tl-rules-footer-note {
    margin-top: 2rem;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg-elev-2);
}

.tl-rules-footer-note p {
    margin: 0 0 12px;
    font-size: 0.94rem;
    line-height: 1.8;
    color: var(--text);
}

.tl-rules-footer-note p:last-child { margin-bottom: 0; }
.tl-rules-footer-note .fa { font-family: var(--tl-r-fa); direction: rtl; text-align: right; }
.tl-rules-footer-note .en { font-family: var(--tl-r-en); direction: ltr; color: var(--text-muted); font-size: 0.88rem; padding-top: 12px; border-top: 1px solid var(--line); }
