/* ابزار توییت ساز فیک — موبایل‌اول (۸۷٪ ترافیک سایت موبایل است) */

.tt-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem 1.5rem;
    text-align: center;
}

.tt-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0 0 .75rem;
    color: var(--text-primary);
}

.tt-sub {
    color: var(--text-secondary);
    font-size: .95rem;
    line-height: 2;
    max-width: 640px;
    margin: 0 auto;
}

/* روی موبایل پیش‌نمایش باید اول بیاید تا کاربر بلافاصله نتیجه را ببیند */
.tt-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tt-preview-col { order: 1; }
.tt-form-col { order: 2; display: flex; flex-direction: column; gap: 1.25rem; }

.tt-preview-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.tt-canvas-wrap {
    display: flex;
    justify-content: center;
    background: repeating-conic-gradient(rgba(255,255,255,.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
    border-radius: var(--radius-md);
    padding: .75rem;
}

/* روی موبایل، پیش‌نمایش مهم‌ترین عنصر صفحه است و نباید ربع عرض صفحه
   صرف حاشیه شود. با این کار بوم روی ۳۷۵px از ۲۷۷ به حدود ۳۴۵ پیکسل می‌رسد. */
@media (max-width: 600px) {
    .tt-layout { padding-left: .5rem; padding-right: .5rem; }
    .tt-preview-box { padding: .6rem; }
    .tt-canvas-wrap { padding: .25rem; }
    .tt-hero { padding-left: .75rem; padding-right: .75rem; }
    .tt-title { font-size: 1.55rem; }
}

#ttCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

.tt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1rem;
}

.tt-btn {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.tt-btn:hover { background: rgba(255,255,255,.08); border-color: var(--border-hover); }
.tt-btn svg { width: 17px; height: 17px; }

.tt-btn-primary {
    background: var(--gradient-1);
    border-color: transparent;
    color: #fff;
}
.tt-btn-primary:hover { opacity: .92; background: var(--gradient-1); }

.tt-status {
    margin: .7rem 0 0;
    min-height: 1.2em;
    font-size: .82rem;
    color: var(--accent);
    text-align: center;
}

/* ── کارت‌های فرم ── */
.tt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.tt-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--text-primary);
}

.tt-field { margin-bottom: 1rem; }
.tt-field:last-child { margin-bottom: 0; }

.tt-field label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
    color: var(--text-secondary);
    margin-bottom: .45rem;
}

.tt-field input[type="text"],
.tt-field textarea,
.tt-field select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .7rem .85rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color .2s;
}

.tt-field input:focus,
.tt-field textarea:focus,
.tt-field select:focus {
    outline: none;
    border-color: var(--primary);
}

.tt-field textarea { resize: vertical; line-height: 1.9; }

.tt-counter { font-size: .75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tt-hint { font-size: .75rem; color: var(--text-muted); margin: .4rem 0 0; }

.tt-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ── عکس پروفایل ── */
.tt-avatar-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.tt-avatar-prev {
    width: 60px; height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #4a5c6d url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b98a5'%3E%3Ccircle cx='12' cy='9' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0z'/%3E%3C/svg%3E") center/60% no-repeat;
    border: 1px solid var(--border);
}
.tt-avatar-prev.has-img { background-image: none; }

.tt-avatar-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }

.tt-file-btn {
    display: inline-block;
    padding: .55rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
    color: var(--text-primary);
    font-size: .82rem;
    cursor: pointer;
    transition: border-color .2s;
}
.tt-file-btn:hover { border-color: var(--primary); }
.tt-file-btn-wide { display: block; text-align: center; margin-bottom: .5rem; }

.tt-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: .78rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.tt-link-btn:hover { color: #f87171; }

/* ── انتخاب حالت رنگی ── */
.tt-theme-row { display: flex; gap: .5rem; }

.tt-theme {
    flex: 1;
    padding: .65rem .5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-family: inherit;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, transform .15s;
}
.tt-theme:hover { transform: translateY(-1px); }
.tt-theme.active { border-color: var(--primary); }

.tt-theme-light { background: #fff; color: #0f1419; }
.tt-theme-dim { background: #15202b; color: #f7f9f9; }
.tt-theme-dark { background: #000; color: #e7e9ea; }

/* ── محتوای سئو ── */
.tt-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem 4rem;
    line-height: 2.1;
    color: var(--text-secondary);
}

.tt-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
}

.tt-content p { margin: 0 0 1rem; }
.tt-content strong { color: var(--text-primary); }

.tt-steps { padding-right: 1.2rem; margin: 0; }
.tt-steps li { margin-bottom: .8rem; }

.tt-faq details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: .75rem;
}

.tt-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: .95rem;
}
.tt-faq details[open] summary { margin-bottom: .6rem; }
.tt-faq p { margin: 0; font-size: .9rem; }

.tt-notice {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(251,191,36,.07);
    border: 1px solid rgba(251,191,36,.25);
    font-size: .85rem;
    color: #fcd34d;
}

/* ── دسکتاپ: دو ستونه، پیش‌نمایش چسبان ── */
@media (min-width: 1024px) {
    .tt-title { font-size: 2.4rem; }

    .tt-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
        padding-bottom: 4rem;
    }

    .tt-preview-col {
        order: 2;
        flex: 1;
        min-width: 0;
        position: sticky;
        top: 90px;
    }

    .tt-form-col {
        order: 1;
        width: 400px;
        flex-shrink: 0;
    }
}
