* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e4e4e7;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 24px;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 4px;
}

.subtitle {
    color: #a1a1aa;
    font-size: 0.95rem;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    background: #1c1c22;
    color: #e4e4e7;
    font-size: 0.9rem;
}

.search-box input:focus {
    outline: none;
    border-color: #6366f1;
}

.search-box select {
    padding: 8px 12px;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    background: #1c1c22;
    color: #e4e4e7;
    font-size: 0.85rem;
    cursor: pointer;
}

.search-box select:focus {
    outline: none;
    border-color: #6366f1;
}

button {
    padding: 8px 16px;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    background: #27272a;
    color: #e4e4e7;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

button:hover {
    background: #3f3f46;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#counter {
    font-size: 0.9rem;
    color: #a1a1aa;
    min-width: 80px;
    text-align: center;
}

/* Loading */
#loading {
    text-align: center;
    padding: 60px 20px;
    color: #a1a1aa;
    font-size: 1.1rem;
}

/* Card */
.card {
    background: #1c1c22;
    border: 1px solid #2e2e36;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid #2e2e36;
}

.badge {
    display: inline-block;
    background: #6366f1;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-header h2 {
    font-size: 1.2rem;
    color: #fff;
    line-height: 1.5;
}

.card-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.time-dep-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.time-dep-yes {
    background: #422006;
    color: #fbbf24;
    border: 1px solid #854d0e;
}

.time-dep-no {
    background: #052e16;
    color: #6ee7b7;
    border: 1px solid #166534;
}

.timestamp-badge {
    margin-left: auto;
    font-size: 0.72rem;
    color: #a1a1aa;
    font-weight: normal;
}

/* Sections */
.section {
    border-bottom: 1px solid #2e2e36;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #d4d4d8;
    user-select: none;
    transition: background 0.15s;
}

.section-title:hover {
    background: #27272a;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
    width: 12px;
}

.section-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.count {
    margin-left: auto;
    font-size: 0.8rem;
    color: #71717a;
    font-weight: normal;
}

.section-content {
    padding: 0 24px 20px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section-content.hidden {
    display: none;
}

/* Answers */
#answersList {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.answer-chip {
    background: #27272a;
    border: 1px solid #3f3f46;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #d4d4d8;
}

.answer-list-item {
    background: #27272a;
    border: 1px solid #3f3f46;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #d4d4d8;
    margin-bottom: 4px;
}

/* Decomposition */
#decompositionList {
    padding-left: 20px;
}

#decompositionList li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #d4d4d8;
}

#decompositionList li::marker {
    color: #6366f1;
    font-weight: bold;
}

/* Provenance */
.prov-step {
    margin-bottom: 16px;
    border: 1px solid #2e2e36;
    border-radius: 8px;
    overflow: hidden;
}

.prov-step-header {
    background: #27272a;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prov-step-header .step-badge {
    background: #4f46e5;
    color: #fff;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
}

.prov-step-body {
    padding: 12px 14px;
}

.prov-field {
    margin-bottom: 8px;
}

.prov-field-label {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.prov-field-value {
    font-size: 0.85rem;
    color: #e4e4e7;
}

.prov-field-value a {
    color: #818cf8;
    text-decoration: none;
}

.prov-field-value a:hover {
    text-decoration: underline;
}

.evidence-sentence {
    background: #1a1a2e;
    border-left: 3px solid #6366f1;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #c4b5fd;
    margin-top: 4px;
}

.prov-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.prov-answer-chip {
    background: #1e3a2e;
    border: 1px solid #2d5a3e;
    color: #6ee7b7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
}

.discrete-badge {
    background: #44403c;
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 8px;
}

/* Responsive */
@media (max-width: 600px) {
    .controls {
        flex-direction: column;
    }
    .card-header {
        padding: 16px;
    }
    .section-title {
        padding: 12px 16px;
    }
    .section-content {
        padding: 0 16px 16px;
    }
}
