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

:root {
    --primary: #F97316;
    --accent: #8B5CF6;
    --bg: #0F172A;
    --surface: #1E293B;
    --surface2: #334155;
    --border: #334155;
    --text: #F1F5F9;
    --text-dim: #94A3B8;
    --font: 'Inter', system-ui, sans-serif;
}

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

header {
    padding: .7rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #060a18, var(--surface));
    display: flex;
    align-items: center;
    gap: .5rem
}

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

.logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem
}

.logo h1 {
    font-size: .92rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

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

.main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    overflow: hidden;
    height: calc(100vh - 62px)
}

.input-panel {
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .65rem
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem
}

.panel-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: .75rem
}

.form-group {
    margin-bottom: .6rem
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem
}

.form-label {
    font-size: .67rem;
    font-weight: 600;
    color: var(--text-dim);
    display: block;
    margin-bottom: .18rem;
    text-transform: uppercase;
    letter-spacing: .05em
}

.form-input,
.form-select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font);
    font-size: .78rem;
    padding: .32rem .5rem;
    outline: none;
    transition: border-color .2s
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary)
}

.btn {
    padding: .35rem .75rem;
    border-radius: 8px;
    border: none;
    font-family: var(--font);
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s
}

.btn-primary {
    background: var(--primary);
    color: #fff
}

.btn-primary:hover {
    background: #ea6c07;
    transform: translateY(-1px)
}

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

.btn-secondary:hover {
    background: #475569
}

.btn-full {
    width: 100%;
    padding: .45rem
}

/* Output */
.output-panel {
    overflow-y: auto;
    padding: 1rem 1.5rem
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: .8rem;
    color: var(--text-dim);
    text-align: center;
    font-size: .88rem
}

.outline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap
}

.outline-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3
}

.outline-meta {
    font-size: .72rem;
    color: var(--text-dim);
    margin-top: .25rem
}

.outline-actions {
    display: flex;
    gap: .35rem;
    flex-shrink: 0
}

.outline-intro {
    background: rgba(249, 115, 22, .08);
    border: 1px solid rgba(249, 115, 22, .2);
    border-radius: 10px;
    padding: .65rem .9rem;
    font-size: .82rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1.1rem;
    font-style: italic
}

/* Section cards */
.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .8rem 1rem;
    margin-bottom: .65rem;
    animation: fadeIn .25s ease;
    transition: border-color .18s
}

.section-card:hover {
    border-color: rgba(249, 115, 22, .3)
}

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

    to {
        opacity: 1;
        transform: none
    }
}

.section-h2 {
    font-size: .92rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: .45rem;
    display: flex;
    align-items: center;
    gap: .5rem
}

.section-num {
    background: rgba(249, 115, 22, .15);
    border: 1px solid rgba(249, 115, 22, .25);
    border-radius: 5px;
    padding: .05rem .35rem;
    font-size: .7rem;
    font-weight: 700;
    color: var(--primary)
}

.section-wc {
    margin-left: auto;
    font-size: .68rem;
    color: var(--text-dim);
    font-family: monospace
}

.section-points {
    list-style: none;
    margin-bottom: .4rem
}

.section-points li {
    font-size: .78rem;
    color: var(--text-dim);
    padding: .2rem 0;
    padding-left: .9rem;
    position: relative;
    line-height: 1.5
}

.section-points li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    opacity: .6
}

.subsections {
    margin-top: .4rem;
    padding-left: .9rem;
    border-left: 2px solid rgba(139, 92, 246, .2)
}

.subsection {
    margin-bottom: .35rem
}

.subsection-h3 {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .15rem
}

.subsection-points {
    list-style: none
}

.subsection-points li {
    font-size: .73rem;
    color: var(--text-dim);
    padding: .1rem 0;
    padding-left: .75rem;
    position: relative
}

.subsection-points li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    opacity: .5;
    font-size: .65rem
}

/* Outro */
.section-outro {
    background: rgba(139, 92, 246, .07);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 10px;
    padding: .65rem .9rem;
    margin-top: .65rem;
    font-size: .8rem;
    color: var(--text-dim);
    line-height: 1.6
}

/* SEO panel */
.seo-keyword-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .5rem
}

.seo-kw {
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: 6px;
    padding: .18rem .45rem;
    font-size: .7rem;
    color: var(--accent);
    font-weight: 600
}

.seo-kw.primary {
    background: rgba(249, 115, 22, .12);
    border-color: rgba(249, 115, 22, .25);
    color: var(--primary)
}

.seo-section-label {
    font-size: .67rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: .5rem 0 .25rem
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: var(--surface)
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary)
}

@media(max-width:720px) {
    .main-layout {
        grid-template-columns: 1fr;
        height: auto
    }

    .form-row {
        grid-template-columns: 1fr
    }
}