:root {
    --primary: #5352ED;
    --primary-hover: #4240C0;
    --primary-glow: rgba(83, 82, 237, .25);
    --secondary: #A4B0FC;
    --accent: #2ED573;
    --accent-red: #FF4757;
    --accent-warn: #FFA502;
    --bg: #0A0A1A;
    --bg-surface: #12122A;
    --bg-elevated: #1A1A3E;
    --bg-card: rgba(26, 26, 62, .8);
    --text: #E2E0F5;
    --text-secondary: #9090C0;
    --text-muted: #5A5A80;
    --border: rgba(83, 82, 237, .12);
    --border-strong: rgba(83, 82, 237, .25);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 250ms cubic-bezier(.4, 0, .2, 1)
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    min-height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased
}

.hidden {
    display: none !important
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10
}

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

.header h1 {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.header-actions {
    display: flex;
    gap: 8px
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition)
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border)
}

.btn-secondary:hover {
    border-color: var(--border-strong);
    color: var(--primary)
}

.main {
    max-width: 840px;
    margin: 0 auto;
    padding: 24px
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px
}

.input-section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.input-group.full-width {
    grid-column: 1/-1
}

.input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em
}

.char-count {
    font-weight: 500;
    color: var(--text-muted)
}

.char-count.warn {
    color: var(--accent-warn)
}

.char-count.over {
    color: var(--accent-red)
}

.input,
.textarea {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: .82rem;
    outline: none;
    transition: border-color var(--transition)
}

.input:focus,
.textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow)
}

.textarea {
    resize: vertical;
    line-height: 1.5
}

.input-hint {
    font-size: .65rem;
    color: var(--text-muted)
}

.previews-section {
    margin-bottom: 24px
}

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px
}

.preview-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 12px
}

/* Twitter */
.twitter-card {
    border: 1px solid #2F3336;
    border-radius: 16px;
    overflow: hidden;
    max-width: 506px;
    background: #15202B;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif
}

.tw-img-wrap {
    overflow: hidden;
    border-bottom: 1px solid #2F3336
}

.tw-img {
    width: 100%;
    aspect-ratio: 2/1;
    background: #1C2732;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center
}

.tw-body {
    padding: 10px 12px
}

.tw-domain {
    font-size: .8rem;
    color: #8899A6;
    margin-bottom: 2px
}

.tw-title {
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 2px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical
}

.tw-desc {
    font-size: .8rem;
    color: #8899A6;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

/* Facebook */
.fb-card {
    border: 1px solid #3A3B3C;
    overflow: hidden;
    max-width: 500px;
    background: #242526;
    font-family: Helvetica, Arial, sans-serif
}

.fb-img {
    width: 100%;
    aspect-ratio: 1.91/1;
    background: #18191A;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center
}

.fb-body {
    padding: 10px 12px;
    border-top: 1px solid #3A3B3C
}

.fb-domain {
    font-size: .75rem;
    color: #B0B3B8;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: 4px
}

.fb-title {
    font-size: .95rem;
    font-weight: 700;
    color: #E4E6EB;
    line-height: 1.2;
    margin-bottom: 2px
}

.fb-desc {
    font-size: .82rem;
    color: #B0B3B8;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

/* LinkedIn */
.li-card {
    border: 1px solid #38434F;
    border-radius: 8px;
    overflow: hidden;
    max-width: 552px;
    background: #1B1F23;
    font-family: -apple-system, system-ui, sans-serif
}

.li-img {
    width: 100%;
    aspect-ratio: 1.91/1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center
}

.li-body {
    padding: 10px 12px
}

.li-title {
    font-size: .9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3
}

.li-domain {
    font-size: .75rem;
    color: #FFFFFFA6
}

/* Google */
.google-card {
    max-width: 600px;
    padding: 12px;
    background: transparent
}

.g-breadcrumb {
    font-size: .82rem;
    color: #BDC1C6;
    margin-bottom: 4px
}

.g-title {
    font-size: 1.15rem;
    font-weight: 400;
    color: #8AB4F8;
    line-height: 1.3;
    margin-bottom: 4px;
    cursor: pointer
}

.g-title:hover {
    text-decoration: underline
}

.g-desc {
    font-size: .85rem;
    color: #BDC1C6;
    line-height: 1.5
}

.placeholder {
    color: #555;
    font-size: .8rem
}

/* Warnings */
.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: .8rem;
    line-height: 1.4
}

.warning-item.warn {
    background: rgba(255, 165, 2, .08);
    color: var(--accent-warn);
    border: 1px solid rgba(255, 165, 2, .2)
}

.warning-item.error {
    background: rgba(255, 71, 87, .08);
    color: var(--accent-red);
    border: 1px solid rgba(255, 71, 87, .2)
}

.warning-item.ok {
    background: rgba(46, 213, 115, .08);
    color: var(--accent);
    border: 1px solid rgba(46, 213, 115, .2)
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    transition: transform .3s ease;
    z-index: 100;
    opacity: 0
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1
}

@media(max-width:768px) {
    .input-grid {
        grid-template-columns: 1fr
    }

    .main {
        padding: 16px
    }
}