/* PREVIEW WRAPPER */

.preview-wrapper{
    margin-top:25px;
    display:flex;
    gap:20px;
    flex-wrap:wrap;
    padding:18px;
    border:1px solid #eceff5;
    border-radius:20px;
    background:
        radial-gradient(circle at top left, rgba(72,114,255,0.08), transparent 34%),
        linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.85);
}

.preview-wrapper.is-hidden{
    display:none;
}

.preview-toggle{
    margin-top:14px;
    padding:10px 14px;
    border:1px solid #d0d7e2;
    border-radius:12px;
    background:#fff;
    color:#344054;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;
}

.tool-action-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:14px;
}

.tool-action-row .preview-toggle{
    margin-top:0;
}

.alt-toggle{
    background:linear-gradient(180deg, #fff4ec 0%, #ffe7d6 100%);
    border-color:#f0c5a3;
    color:#9a3412;
}

.alt-toggle:hover{
    background:#ffeddc;
    border-color:#e8b48b;
}

.preview-toggle:hover{
    background:#f8fafc;
    border-color:#b9c4d5;
}

.preview-toggle:active,
.custom-style-manual-btn:active,
.custom-style-reset:active,
.custom-style-place:active,
.custom-style-chip:active{
    transform:scale(.98);
}

.custom-style-panel{
    margin-top:16px;
    padding:20px;
    border:1px solid #eadfd7;
    border-radius:20px;
    background:
        radial-gradient(circle at top right, rgba(255,190,143,0.18), transparent 34%),
        linear-gradient(180deg, #fffdfb 0%, #fff7f1 100%);
    box-shadow:0 12px 28px rgba(146, 64, 14, 0.07);
}

.custom-style-panel.is-hidden{
    display:none;
}

.custom-style-panel-head{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    margin-bottom:12px;
}

.custom-style-title{
    font-size:17px;
    font-weight:700;
    color:#7c2d12;
}

.custom-style-subtitle{
    margin-top:4px;
    max-width:620px;
    font-size:13px;
    line-height:1.55;
    color:#9a3412;
}

.custom-style-tip{
    margin-bottom:16px;
    padding:10px 12px;
    border:1px solid #f3dfce;
    border-radius:14px;
    background:rgba(255,255,255,0.72);
    color:#8a3a16;
    font-size:12px;
    line-height:1.55;
}

.custom-style-builder{
    margin-bottom:18px;
    padding:14px;
    border:1px solid #f1dfd0;
    border-radius:18px;
    background:rgba(255,255,255,0.7);
}

.custom-style-builder-title{
    font-size:13px;
    font-weight:700;
    color:#7c2d12;
}

.custom-style-placement{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.custom-style-place{
    border:1px solid #efd7c2;
    background:#fff;
    color:#8a3a16;
    border-radius:999px;
    padding:8px 12px;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    transition:all .2s ease;
}

.custom-style-place:hover{
    background:#fff8f2;
    border-color:#e3b792;
}

.custom-style-place.is-active{
    background:linear-gradient(180deg, #9a3412 0%, #7c2d12 100%);
    border-color:#7c2d12;
    color:#fff7ed;
    box-shadow:0 10px 18px rgba(124,45,18,0.18);
}

.custom-style-slots{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:10px;
    margin-top:12px;
}

.custom-style-slot{
    padding:12px;
    border:1px solid #f1dfd0;
    border-radius:14px;
    background:#fff;
}

.custom-style-slot-label{
    font-size:11px;
    font-weight:700;
    color:#9a3412;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.custom-style-slot-value{
    margin-top:7px;
    min-height:20px;
    font-size:14px;
    font-weight:600;
    color:#3b2314;
    word-break:break-word;
}

.custom-style-manual{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:12px;
}

.custom-style-manual-input{
    flex:1 1 240px;
    min-width:0;
    padding:11px 13px;
    border:1px solid #efd7c2;
    border-radius:12px;
    background:#fff;
    color:#3b2314;
    font-size:13px;
}

.custom-style-manual-input:focus{
    outline:none;
    border-color:#e3b792;
    box-shadow:0 0 0 3px rgba(243, 180, 138, 0.18);
}

.custom-style-manual-btn{
    padding:11px 14px;
    border:1px solid #f0c9aa;
    border-radius:12px;
    background:#fff;
    color:#9a3412;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
    transition:all .2s ease;
}

.custom-style-manual-btn:hover{
    background:#fff7f1;
    border-color:#e6b992;
}

.custom-style-reset{
    padding:9px 12px;
    border:1px solid #f0c9aa;
    border-radius:12px;
    background:#fff;
    color:#9a3412;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    transition:all .2s ease;
}

.custom-style-reset:hover{
    background:#fff7f1;
    border-color:#e6b992;
}

.custom-style-group + .custom-style-group{
    margin-top:16px;
}

.custom-style-label{
    margin-bottom:9px;
    font-size:13px;
    font-weight:700;
    color:#7c2d12;
    letter-spacing:.01em;
}

.custom-style-options{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.custom-style-chip{
    min-width:52px;
    padding:9px 13px;
    border:1px solid #efd7c2;
    border-radius:999px;
    background:#fff;
    color:#7c2d12;
    font-size:13px;
    font-weight:600;
    cursor:pointer;
    box-shadow:0 4px 12px rgba(124,45,18,0.04);
    transition:
        border-color .2s ease,
        background-color .2s ease,
        color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.custom-style-chip:hover{
    border-color:#e3b792;
    background:#fffaf6;
    box-shadow:0 8px 18px rgba(124,45,18,0.08);
    transform:translateY(-1px);
}

.custom-style-chip.is-selected{
    background:linear-gradient(180deg, #9a3412 0%, #7c2d12 100%);
    border-color:#7c2d12;
    color:#fff7ed;
    box-shadow:0 10px 18px rgba(124,45,18,0.18);
}

.custom-style-chip-more{
    border-style:dashed;
}

.custom-style-more-emoji{
    margin-top:-4px;
    margin-bottom:14px;
    padding:12px;
    border:1px solid #f1dfd0;
    border-radius:16px;
    background:rgba(255,255,255,0.78);
}

.custom-style-more-emoji.is-hidden{
    display:none;
}

.custom-style-more-emoji-head{
    margin-bottom:10px;
    font-size:12px;
    font-weight:700;
    color:#9a3412;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.custom-style-more-emoji-grid{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

@media (max-width:640px){
    .preview-wrapper{
        padding:14px;
        gap:14px;
        border-radius:16px;
    }

    .tool-action-row{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
    }

    .tool-action-row .preview-toggle,
    .preview-toggle{
        width:100%;
        justify-content:center;
        text-align:center;
    }

    .custom-style-panel{
        margin-top:14px;
        padding:16px;
        border-radius:16px;
    }

    .custom-style-panel-head{
        flex-direction:column;
        align-items:stretch;
    }

    .custom-style-reset{
        width:100%;
    }

    .custom-style-placement{
        display:grid;
        grid-template-columns:1fr;
    }

    .custom-style-place{
        width:100%;
        text-align:center;
    }

    .custom-style-options,
    .custom-style-more-emoji-grid{
        gap:10px;
    }

    .custom-style-chip{
        min-width:58px;
        padding:10px 14px;
    }

    .custom-style-slot{
        padding:11px;
    }

    .custom-style-slot-value{
        min-height:24px;
        font-size:15px;
    }
}

.custom-style-chip-extra{
    min-width:44px;
}

.custom-style-live{
    margin-top:20px;
    padding:16px 18px;
    border-radius:18px;
    background:linear-gradient(180deg, #ffffff 0%, #fffaf6 100%);
    border:1px solid #f1dfd0;
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.9);
}

.custom-style-live-label{
    font-size:12px;
    font-weight:700;
    color:#9a3412;
    text-transform:uppercase;
    letter-spacing:.06em;
}

.custom-style-live-value{
    margin-top:8px;
    min-height:32px;
    font-size:16px;
    line-height:1.65;
    color:#3b2314;
    white-space:pre-wrap;
    word-break:break-word;
}

@media (max-width: 640px){
    .custom-style-slots{
        grid-template-columns:1fr;
    }

    .custom-style-manual{
        flex-direction:column;
    }

    .custom-style-manual-btn{
        width:100%;
    }
}

/* PREVIEW CARD */

.preview-box{
    flex:1;
    min-width:260px;
    background:#ffffff;
    border:1px solid #e5e5e5;
    border-radius:12px;
    padding:16px;
    box-shadow:0 3px 10px rgba(0,0,0,0.04);
}

#preview{
    font-size:16px;
    line-height:1.5;
}

.preview-text{
    margin-top:10px;
    padding-left:2px;
    font-size:14px;
    line-height:1.65;
    white-space:pre-wrap;
    word-break:break-word;
}

.insta-bio,
.fb-text,
.tw-text,
.yt-text,
.li-text{
    margin-top:10px;
}

.social-card{
    width:100%;
    background:#fff;
    border-radius:20px;
    padding:16px;
    box-shadow:0 18px 45px rgba(23,33,61,0.08);
    border:1px solid rgba(16,24,40,0.08);
    backdrop-filter:blur(8px);
}

.social-header{
    display:flex;
    align-items:center;
    gap:12px;
}

.social-avatar{
    flex:0 0 auto;
    width:42px;
    height:42px;
    border-radius:50%;
    background:linear-gradient(135deg, #cfd8e8, #aab9d6);
}

.social-meta{
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:2px;
}

.social-user{
    font-size:14px;
    font-weight:700;
    color:#111827;
    letter-spacing:-0.01em;
}

.social-handle,
.social-subtle{
    font-size:12px;
    color:#667085;
}

.social-verified{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:16px;
    height:16px;
    margin-left:6px;
    border-radius:50%;
    background:#1d9bf0;
    color:#fff;
    font-size:10px;
    line-height:1;
    vertical-align:middle;
}

.social-dots{
    margin-left:auto;
    color:#98a2b3;
    letter-spacing:2px;
}

.social-media-surface{
    position:relative;
    border-radius:18px;
    overflow:hidden;
}

.social-sheen{
    position:absolute;
    inset:0;
    background:linear-gradient(135deg, rgba(255,255,255,0.5), rgba(255,255,255,0) 45%);
    pointer-events:none;
}

.social-media-badge{
    position:absolute;
    right:12px;
    bottom:12px;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(17,24,39,0.72);
    color:#fff;
    font-size:12px;
    font-weight:600;
}

.social-icon-row{
    display:flex;
    align-items:center;
    gap:14px;
    margin-top:12px;
    font-size:16px;
}

.social-icon-row .push-right{
    margin-left:auto;
}

.social-action-bar{
    display:flex;
    justify-content:space-around;
    align-items:center;
    gap:12px;
    margin-top:12px;
    padding-top:10px;
    border-top:1px solid #eaecf0;
    font-size:13px;
    font-weight:600;
    color:#475467;
}

.social-stats,
.fb-social-summary,
.muted-row,
.char-count{
    margin-top:10px;
    font-size:13px;
    color:#667085;
}

.fb-social-summary,
.li-stats{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
}

.social-chip{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:4px 8px;
    border-radius:999px;
    background:#eff4ff;
    color:#175cd3;
    font-weight:600;
}

.insta-card{
    border-top:4px solid #E1306C;
}

.insta-image{
    height:240px;
    margin:14px 0 10px;
    background:
        linear-gradient(135deg, rgba(225,48,108,0.18), rgba(88,81,219,0.18)),
        linear-gradient(160deg, #f7f9fc, #eef2f8);
}

.fb-card{
    border-top:4px solid #1877f2;
}

.fb-banner{
    height:110px;
    margin-top:12px;
    background:
        linear-gradient(135deg, rgba(24,119,242,0.16), rgba(24,119,242,0.04)),
        linear-gradient(160deg, #f7faff, #edf4ff);
}

.tw-card{
    border-top:4px solid #1DA1F2;
    background:linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.tweet-panel{
    margin-top:12px;
    padding:12px;
    border:1px solid #e5e7eb;
    border-radius:16px;
    background:linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
}

.tweet-line{
    height:8px;
    border-radius:999px;
    background:#d7e4f5;
}

.tweet-line + .tweet-line{
    margin-top:8px;
}

.tweet-line-long{
    width:100%;
}

.tweet-line-mid{
    width:68%;
}

.yt-card{
    border-top:4px solid #FF0000;
}

.yt-reply{
    margin-top:8px;
    font-weight:600;
}

.li-card{
    border-top:4px solid #0A66C2;
}

.li-pill-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:10px;
}

.li-pill{
    padding:5px 10px;
    border-radius:999px;
    background:#eef4ff;
    color:#175cd3;
    font-size:12px;
    font-weight:600;
}

.insta-caption,
.fb-body,
.tw-body,
.yt-body,
.li-body{
    font-size:14px;
    color:#101828;
}

/* MOBILE */
@media (max-width:767px){
    .tool-action-row{
        flex-direction:column;
    }

    .custom-style-panel{
        padding:14px;
        border-radius:16px;
    }

    .custom-style-panel-head{
        flex-direction:column;
    }

    .custom-style-chip{
        min-width:42px;
        padding:8px 10px;
    }

    .preview-wrapper{
        display:flex;
        padding:12px;
        border-radius:16px;
    }

    .social-card,
    .preview-box{
        padding:12px;
        border-radius:16px;
    }

    .insta-image{
        height:160px;
    }

    .fb-banner{
        height:78px;
    }

    .social-header{
        gap:10px;
    }

    .social-avatar{
        width:36px;
        height:36px;
    }

    .social-action-bar,
    .social-icon-row{
        gap:10px;
        font-size:12px;
    }
}

/* TABLET */
@media (min-width:768px) and (max-width:1024px){
    .preview-wrapper{
        display:block;
    }

    .li-card,
    .tw-card,
    .fb-card,
    .insta-card,
    .yt-card{
        max-width:100%;
    }
}

/* DESKTOP */
@media (min-width:1025px){
    .preview-wrapper{
        display:flex;
        justify-content:center;
    }

    .li-card,
    .tw-card,
    .fb-card,
    .insta-card,
    .yt-card{
        max-width:540px;
        width:100%;
    }
}
