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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f6f8;
    min-height: 100vh;
    padding: 24px;
    color: #111827;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
    overflow: hidden;
}

header {
    background: #111827;
    color: #f9fafb;
    padding: 28px 40px;
    text-align: center;
}

header h1 {
    font-size: 30px;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

header p {
    font-size: 15px;
    opacity: 0.8;
}

.controls {
    padding: 24px 40px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.controls button {
    align-self: flex-start;
    margin-top: 22px;
}

.input-group {
    flex: 1;
    min-width: 260px;
}

.input-group.compact {
    flex: 0 0 auto;
    min-width: auto;
}

.input-group.compact #articleId {
    width: 18ch;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #111827;
    font-size: 13px;
}

.input-group select,
.input-group input {
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #ffffff;
    color: #111827;
}

.input-group select {
    height: 44px;
}

.input-group .text-button {
    margin-top: 10px;
    padding: 0;
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.input-group .text-button:hover {
    color: #334155;
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}

.input-group .text-button:active {
    color: #1f2937;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
    padding: 12px 28px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
    background: #1d4ed8;
}

.secondary-button {
    background: #0f172a;
}

.secondary-button:hover {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
}

.secondary-button:active {
    background: #0b1221;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ghost-button {
    background: #ffffff;
    color: #2563eb;
    border: 1px solid #d1d5db;
    box-shadow: none;
    padding: 10px 18px;
}

.ghost-button:hover {
    background: #f3f4f6;
    box-shadow: none;
    transform: translateY(-1px);
}

.ghost-button:active {
    background: #e5e7eb;
}

.error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 14px 40px;
    border-left: 4px solid #b91c1c;
    margin: 0;
}

.loading {
    padding: 56px 40px;
    text-align: center;
}

.notice {
    background: #ecfdf3;
    color: #166534;
    padding: 12px 40px;
    border-left: 4px solid #22c55e;
    font-weight: 600;
}

.spinner {
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    animation: spin 1s linear infinite;
    margin: 0 auto 18px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0;
    min-height: 640px;
    background: #ffffff;
}

.version-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-top {
    display: flex;
    flex-direction: column;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header {
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header .ghost-button {
    padding: 6px 12px;
    font-size: 12px;
    border-color: rgba(255, 255, 255, 0.6);
}

.panel-header .ghost-button:hover {
    background: rgba(255, 255, 255, 0.9);
}

.panel-header.published {
    background: #0f766e;
    color: #ecfeff;
}

.panel-header.working-copy {
    background: #b45309;
    color: #f9fafb;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.status-inline {
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
    color: rgba(255,255,255,0.85);
}

.badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
}

.panel-meta {
    padding: 14px 28px;
    font-size: 13px;
    color: #4b5563;
    background: #f9fafb;
}

.panel-meta .meta-item {
    margin-bottom: 4px;
}

.panel-meta .meta-item strong {
    color: #111827;
    margin-right: 5px;
}

.panel-content {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    line-height: 1.6;
    background: #ffffff;
}

.panel-content h1 {
    font-size: 27px;
    margin-bottom: 18px;
    color: #111827;
}

.panel-content h2 {
    font-size: 22px;
    margin-top: 28px;
    margin-bottom: 14px;
    color: #111827;
}

.panel-content h3 {
    font-size: 18px;
    margin-top: 22px;
    margin-bottom: 10px;
    color: #111827;
}

.panel-content p {
    margin-bottom: 14px;
    color: #374151;
}

.panel-content ul,
.panel-content ol {
    margin-left: 24px;
    margin-bottom: 14px;
    color: #374151;
}

.panel-content li {
    margin-bottom: 8px;
}

.panel-content a {
    color: #2563eb;
    text-decoration: none;
}

.panel-content a:hover {
    text-decoration: underline;
}

.panel-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.92em;
}

.panel-content pre {
    background: #f3f4f6;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.panel-content blockquote {
    background: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 12px 16px;
    margin: 12px 0;
    color: #1f2937;
    border-radius: 6px;
}

.panel-content .callout,
.panel-content .note-callout,
.panel-content .warning-callout,
.panel-content .tip-callout,
.panel-content .alert {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 12px 0;
    border-left: 4px solid #2563eb;
}

.panel-content .callout.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.panel-content .warning-callout {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.panel-content .callout.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.panel-content .note-callout {
    border-left-color: #f59e0b;
    background: #fffbeb;
    border-color: #fcd34d;
}

.panel-content .tip-callout {
    border-left-color: #2563eb;
    background: #eff6ff;
}

.panel-content .note-callout:before {
    content: "Hinweis";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.panel-content .warning-callout:before {
    content: "Wichtig";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #b91c1c;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.panel-content .tip-callout:before {
    content: "Tipp";
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

.panel-content .callout .callout-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #111827;
}

.panel-content img {
    max-width: 320px;
    height: auto;
    display: block;
    margin: 12px 0;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.input-group select option {
    color: #111827;
}

/* Improve meta layout visibility */
.panel-meta {
    display: grid;
    row-gap: 6px;
}

.description-box {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.description-label {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.description-text {
    color: #4b5563;
    line-height: 1.5;
}

.tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.tag-common {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.tag-added {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.tag-removed {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.change-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
    margin-left: 6px;
}

.change-same {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.change-added {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.change-removed {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.tag-legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
}

.tag-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.tag-dot.tag-common {
    background: #0ea5e9;
}

.tag-dot.tag-added {
    background: #22c55e;
}

.tag-dot.tag-removed {
    background: #ef4444;
}

.link-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 6px;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.link-chip-button {
    background: transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.link-chip-button:hover {
    transform: translateY(-1px);
}

.link-chip-button.is-active {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
}

.link-ok {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.link-draft {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.link-missing {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.link-unknown {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.link-check-list {
    list-style: none;
    padding-left: 0;
    margin: 6px 0 0;
    display: grid;
    row-gap: 6px;
}

.link-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.link-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.link-status.link-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.link-status.link-draft {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fdba74;
}

.link-status.link-missing {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.link-status.link-unknown {
    background: #e5e7eb;
    color: #4b5563;
    border-color: #d1d5db;
}

.panel-content .article-link.link-highlight {
    background: #fef9c3;
    box-shadow: inset 0 0 0 2px #facc15;
    border-radius: 4px;
    padding: 0 2px;
}

.panel-content .article-link.link-dim {
    opacity: 0.45;
}

.divider {
    background: #e5e7eb;
    width: 1px;
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        border-radius: 0;
    }

    .comparison-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1px auto;
    }

    .divider {
        width: 100%;
        height: 1px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }

    .controls {
        padding: 18px;
    }

    .panel-content {
        padding: 20px;
    }
}
