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

:root {
    --primary: #22C55E;
    --accent: #4ADE80;
    --bg: #111827;
    --surface: #1F2937;
    --surface2: #374151;
    --border: #374151;
    --text: #F9FAFB;
    --text-dim: #9CA3AF;
    --feat: #3B82F6;
    --fix: #EF4444;
    --docs: #F59E0B;
    --chore: #8B5CF6;
    --perf: #06B6D4;
    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #0d1f14 0%, var(--surface) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.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: 1rem;
    font-weight: 700;
    color: var(--primary);
}

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

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    outline: none;
    width: 110px;
    transition: border-color 0.2s;
}

.meta-input:focus {
    border-color: var(--primary);
}

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

.btn {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: none;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

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

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

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

.btn-secondary:hover {
    background: #4B5563;
}

/* Layout */
.app-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 62px);
}

/* Panels */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
}

.panel-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.panel-actions {
    display: flex;
    gap: 0.4rem;
}

.left-panel {
    border-right: 1px solid var(--border);
}

textarea#raw-input {
    flex: 1;
    background: #0d1519;
    border: none;
    color: #86EFAC;
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 1rem;
    resize: none;
    outline: none;
    line-height: 1.6;
}

textarea#raw-input::placeholder {
    color: #374151;
}

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

.empty-output {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
    gap: 0.75rem;
}

.empty-icon {
    font-size: 2.5rem;
    opacity: 0.4;
}

.empty-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.empty-sub {
    font-size: 0.74rem;
    max-width: 260px;
    line-height: 1.5;
}

/* Changelog output */
.changelog {
    max-width: 640px;
    animation: fadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: none;
    }
}

.cl-header {
    margin-bottom: 1.5rem;
}

.cl-version {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cl-date {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

.cl-section {
    margin-bottom: 1.25rem;
}

.cl-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.cl-section-title.feat {
    background: rgba(59, 130, 246, 0.15);
    color: var(--feat);
}

.cl-section-title.fix {
    background: rgba(239, 68, 68, 0.15);
    color: var(--fix);
}

.cl-section-title.docs {
    background: rgba(245, 158, 11, 0.15);
    color: var(--docs);
}

.cl-section-title.chore {
    background: rgba(139, 92, 246, 0.15);
    color: var(--chore);
}

.cl-section-title.perf {
    background: rgba(6, 182, 212, 0.15);
    color: var(--perf);
}

.cl-section-title.other {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-dim);
}

.cl-list {
    list-style: none;
}

.cl-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cl-item:last-child {
    border-bottom: none;
}

.cl-bullet {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.cl-scope {
    color: var(--accent);
    font-weight: 600;
}

.cl-hash {
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    background: var(--surface2);
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    flex-shrink: 0;
    margin-left: auto;
}

.highlight-anim {
    animation: highlight 0.6s ease;
}

@keyframes highlight {
    0% {
        background: rgba(34, 197, 94, 0.15);
    }

    100% {
        background: transparent;
    }
}

/* Format toggle */
.format-tabs {
    display: flex;
    gap: 0.25rem;
}

.fmt-tab {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-dim);
    transition: all 0.15s;
}

.fmt-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

/* Scrollbar */
::-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: 700px) {
    .app-body {
        grid-template-columns: 1fr;
        grid-template-rows: 50% 50%;
    }

    .left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}