:root {
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --bg: #1A1A2E;
    --surface: #222244;
    --surface-2: #2A2A52;
    --border: rgba(66, 133, 244, .12);
    --border-hover: rgba(66, 133, 244, .3);
    --primary: #4285F4;
    --primary-glow: rgba(66, 133, 244, .2);
    --secondary: #34A853;
    --accent: #FBBC05;
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --green: #34A853;
    --red: #EA4335;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .25s ease
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 20% 0%, rgba(66, 133, 244, .04) 0%, transparent 50%)
}

.header {
    padding: .85rem 2rem;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(26, 26, 46, .85);
    position: sticky;
    top: 0;
    z-index: 50
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem
}

.logo {
    display: flex;
    align-items: center;
    gap: .65rem
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(66, 133, 244, .1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1.1rem
}

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

.header-tagline {
    font-size: .8rem;
    color: var(--text-muted)
}

.main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 2rem 3rem
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn .4s ease backwards
}

.section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .75rem
}

.hint {
    font-size: .75rem;
    color: var(--text-dim);
    margin-bottom: .5rem
}

.html-input {
    width: 100%;
    resize: vertical;
    padding: .65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: .75rem;
    line-height: 1.5;
    outline: none;
    margin-bottom: .5rem
}

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

.input-actions {
    display: flex;
    gap: .5rem
}

/* Score */
.score-row {
    display: flex;
    align-items: center;
    gap: 1.25rem
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--primary);
    flex-shrink: 0
}

.score-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1
}

.score-label {
    font-size: .6rem;
    color: var(--text-dim)
}

.score-title {
    font-size: 1rem;
    font-weight: 700
}

.score-desc {
    font-size: .8rem;
    color: var(--text-muted)
}

.score-good .score-circle {
    border-color: var(--green)
}

.score-ok .score-circle {
    border-color: var(--accent)
}

.score-bad .score-circle {
    border-color: var(--red)
}

/* Google SERP */
.serp-preview {
    padding: .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm)
}

.serp-url {
    font-size: .7rem;
    color: var(--text-dim);
    margin-bottom: .15rem
}

.serp-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: .2rem;
    cursor: pointer
}

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

.serp-desc {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.4
}

/* Facebook OG */
.og-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden
}

.og-image {
    height: 200px;
    background: #2a2a52;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: .8rem
}

.og-body {
    padding: .65rem
}

.og-site {
    font-size: .65rem;
    color: var(--text-dim);
    text-transform: uppercase
}

.og-title {
    font-size: .9rem;
    font-weight: 700;
    margin: .2rem 0
}

.og-desc {
    font-size: .75rem;
    color: var(--text-muted)
}

/* Twitter */
.tw-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden
}

.tw-image {
    height: 180px;
    background: #2a2a52;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: .8rem
}

.tw-body {
    padding: .65rem
}

.tw-title {
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .15rem
}

.tw-desc {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .15rem
}

.tw-site {
    font-size: .65rem;
    color: var(--text-dim)
}

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

.warn-item {
    display: flex;
    gap: .5rem;
    padding: .4rem .65rem;
    border-radius: 6px;
    font-size: .75rem;
    align-items: flex-start
}

.warn-error {
    background: rgba(234, 67, 53, .08);
    color: var(--red)
}

.warn-warning {
    background: rgba(251, 188, 5, .08);
    color: var(--accent)
}

.warn-ok {
    background: rgba(52, 168, 83, .08);
    color: var(--green)
}

.warn-icon {
    flex-shrink: 0
}

/* Meta table */
.meta-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm)
}

.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .75rem
}

.meta-table th {
    padding: .4rem .6rem;
    text-align: left;
    background: var(--surface-2);
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted)
}

.meta-table td {
    padding: .35rem .6rem;
    border-top: 1px solid var(--border);
    word-break: break-word
}

.meta-table td:first-child {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    width: 180px
}

/* JSON-LD */
.jsonld-viewer {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem;
    font-family: var(--font-mono);
    font-size: .7rem;
    line-height: 1.5;
    color: var(--accent);
    overflow: auto;
    max-height: 300px;
    white-space: pre-wrap;
    word-break: break-word
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), #1A73E8);
    color: #fff;
    padding: .5rem .9rem;
    font-weight: 600;
    box-shadow: 0 4px 16px var(--primary-glow)
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--primary-glow)
}

.btn--ghost {
    background: transparent;
    color: var(--text-muted);
    padding: .35rem .6rem
}

.btn--ghost:hover {
    background: rgba(66, 133, 244, .08);
    color: var(--text)
}

.btn--sm {
    font-size: .75rem;
    padding: .3rem .5rem
}

.hidden {
    display: none !important
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 100
}

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

.previews {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem
}

@media(max-width:768px) {
    .header {
        padding: .75rem 1rem
    }

    .main {
        padding: 1rem
    }

    .score-row {
        flex-direction: column;
        align-items: flex-start
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}