* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, system-ui, sans-serif
}

:root {
    --bg: #18191a;
    --card: #242526;
    --text: #e4e6eb;
    --accent: #1877f2;
    --border: #3a3b3c;
    --header-h: 60px;
    --btn-active: #0a66c2
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f0f2f5;
        --card: #fff;
        --text: #050505;
        --accent: #1877f2;
        --border: #e4e6eb
    }
}

[data-theme="light"] {
    --bg: #f0f2f5;
    --card: #fff;
    --text: #050505;
    --accent: #1877f2;
    --border: #e4e6eb
}

[data-theme="dark"] {
    --bg: #18191a;
    --card: #242526;
    --text: #e4e6eb;
    --accent: #1877f2;
    --border: #3a3b3c
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden
}

header {
    height: var(--header-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1)
}

.page-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    overflow: hidden;
    justify-content: center
}

.ad-gutter {
    width: 230px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: rgba(0, 0, 0, .02)
}

.skyscraper {
    width: 100%;
    height: 100%;
    background: rgba(139, 92, 246, .05);
    border: 1px dashed var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--accent);
    writing-mode: vertical-rl
}

.app-container {
    flex: 1;
    max-width: 800px;
    display: flex;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    overflow: hidden
}

.preview-pane {
    width: 270px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(0, 0, 0, .02);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 20px 0
}

.preview-pane::-webkit-scrollbar {
    width: 4px
}

.preview-pane::-webkit-scrollbar-track {
    background: transparent
}

.preview-pane::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px
}

.results-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden
}

.phone-shell {
    width: 260px;
    height: 440px;
    border: 10px solid #111;
    border-radius: 35px;
    background: #000;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
    margin: auto;
    flex-shrink: 0
}

#mock-container {
    height: calc(100% - 25px);
    width: 100%;
    position: relative;
    overflow: hidden
}

.status-bar {
    height: 25px;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #fff
}

.mockup {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden
}

.mockup.active {
    display: block
}

.tt-ui-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px 15px 45px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .9));
    color: #fff
}

.ig-app {
    background: #fff;
    color: #000
}

.ig-header {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border-bottom: 1px solid #efefef;
    font-weight: 700;
    font-size: 14px
}

.ig-stats-row {
    display: flex;
    padding: 10px 15px;
    align-items: center;
    justify-content: space-between;
    text-align: center
}

.ig-stat-val {
    display: block;
    font-weight: 700;
    font-size: 14px
}

.ig-stat-label {
    font-size: 10px;
    color: #666
}

.fb-app {
    background: #fff;
    color: #000
}

.platform-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 15px;
    scrollbar-width: none;
    flex-shrink: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border)
}

.plat-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    text-transform: uppercase;
    transition: all .2s
}

[data-theme="light"] .plat-btn {
    background: #e4e6eb;
    color: #050505
}

@media (prefers-color-scheme: light) {
    :root .plat-btn {
        background: #e4e6eb;
        color: #050505
    }
}

.plat-btn:hover {
    background: var(--btn-active);
    color: #fff;
    border-color: var(--btn-active)
}

.plat-btn.active {
    background: var(--btn-active);
    color: #fff;
    border: none
}

.theme-slider {
    position: relative;
    width: 50px;
    height: 24px
}

.slider-track {
    width: 100%;
    height: 24px;
    background: linear-gradient(to right, #1a1a2e 0%, #16213e 33%, #0f3460 66%, #ffd700 100%);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border)
}

.slider-thumb {
    width: 20px;
    height: 20px;
    background: var(--card);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 1px solid var(--accent)
}

.font-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    gap: 5px;
    padding-bottom: 100px;
    grid-template-columns: 1fr;
    max-width: 100%
}

.font-list::-webkit-scrollbar {
    width: 4px
}

.font-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px
}

.font-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column
}

.fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s
}

.fav-btn:hover {
    opacity: 1
}

.font-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px)
}

.font-card.selected {
    border-color: var(--btn-active);
    background: var(--btn-active);
    color: #fff;
    border-width: 2px
}

.font-card.multi-selected {
    border-color: #9146ff;
    background: #9146ff;
    color: #fff;
    border-width: 2px
}

.f-out {
    font-size: 18px;
    color: var(--text);
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    width: 100%;
    max-width: 100%;
    display: block;
    padding-right: 30px;
    flex: 1
}

.font-card.selected .f-out {
    color: #fff
}

.prev-text {
    transition: font-size 0.2s ease
}

.input-tray {
    padding: 15px;
    background: var(--card);
    border-top: 1px solid var(--border);
    flex-shrink: 0
}

input, textarea {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    display: block;
    padding: 12px 20px;
    border-radius: 25px;
    border: 2px solid var(--accent);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    outline: 0;
    font-family: inherit
}

textarea {
    border-radius: 15px;
    resize: none;
    min-height: 50px;
    line-height: 1.4;
    direction: ltr;
    overflow: hidden
}

textarea::placeholder {
    font-size: 12px
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.mini-flex {
    display: flex;
    align-items: center;
    gap: 15px
}

#toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1877f2;
    color: #fff;
    padding: 10px 25px;
    border-radius: 30px;
    display: none;
    z-index: 2000;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .2)
}

#seo-content::-webkit-scrollbar {
    width: 4px
}

#seo-content::-webkit-scrollbar-track {
    background: transparent
}

#seo-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px
}

#seo-content::-webkit-scrollbar-thumb:hover {
    background: #166fe5
}

[data-theme="light"] #seo-content::-webkit-scrollbar-thumb {
    background: #1877f2
}

[data-theme="light"] #seo-content::-webkit-scrollbar-thumb:hover {
    background: #166fe5
}

@media (max-width:1024px) {
    .ad-gutter {
        display: none
    }
    .app-container {
        flex-direction: column;
        border: none
    }
    .preview-pane {
        width: 100%;
        height: 290px;
        border-right: none;
        border-bottom: 1px solid var(--border)
    }
}

@media (max-width:768px) {
    .btn-text {
        display: none
    }
    #seo-content {
        padding: 10px !important
    }
    #seo-content > div {
        padding: 20px !important;
        font-size: 15px !important;
        line-height: 1.6 !important
    }
    #seo-content h1 {
        font-size: 28px !important;
        line-height: 1.2 !important
    }
    #seo-content h2 {
        font-size: 24px !important
    }
    #seo-content h3 {
        font-size: 20px !important
    }
    #seo-content .grid {
        grid-template-columns: 1fr !important
    }
    #seo-content .comparison-card {
        min-width: auto !important;
        padding: 20px !important
    }
    #seo-content .comparison-card div[style*="position: absolute"] {
        position: static !important;
        margin-bottom: 15px !important;
        display: block !important
    }
}

@media (min-width:769px) and (max-width:1024px) {
    #seo-content {
        padding: 15px !important
    }
    #seo-content > div {
        padding: 30px !important;
        font-size: 16px !important
    }
    #seo-content h1 {
        font-size: 36px !important
    }
    #seo-content h2 {
        font-size: 28px !important
    }
    #seo-content .grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important
    }
}


@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}


@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
