:root {
    --test-e-bg: var(--bg-primary);
    --test-e-surface: linear-gradient(
        180deg,
        rgba(26, 39, 68, 0.88),
        rgba(15, 23, 42, 0.94)
    );
    --test-e-text: var(--text-primary);
    --test-e-muted: var(--text-secondary);
    --test-e-border: var(--border);
    --test-e-primary: var(--primary);
    --test-e-primary-contrast: #ffffff;
    --test-e-accent: rgba(99, 102, 241, 0.14);
    --test-e-danger: #fca5a5;
    --test-e-tag-bg: rgba(148, 163, 184, 0.12);
}

.test-e-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2.5rem;
    color: var(--test-e-text);
}

.test-e-resource,
.test-e-related,
.test-e-report {
    background: var(--test-e-surface);
    border: 1px solid var(--test-e-border);
    border-radius: 16px;
    padding: 1rem;
}

.test-e-resource {
    display: grid;
    gap: 1rem;
}

.test-e-resource-header {
    display: grid;
    gap: 0.85rem;
}

.test-e-resource-meta {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.test-e-badge {
    display: inline-flex;
    align-items: center;
    background: var(--test-e-accent);
    border: 1px solid var(--test-e-border);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    color: var(--test-e-muted);
}

.test-e-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.6vw, 2rem);
    line-height: 1.2;
}

.test-e-summary {
    margin: 0;
    color: var(--test-e-muted);
    line-height: 1.55;
}

.test-e-metadata {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.test-e-metadata div {
    border: 1px solid var(--test-e-border);
    border-radius: 12px;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
}

.test-e-metadata dt {
    font-size: 0.75rem;
    color: var(--test-e-muted);
    margin-bottom: 0.2rem;
}

.test-e-metadata dd {
    margin: 0;
    font-weight: 700;
}

.test-e-cta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.test-e-button,
.test-e-button-ghost,
.test-e-more-button,
.test-e-report-form button {
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0.55rem 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.test-e-button,
.test-e-report-form button {
    color: var(--test-e-primary-contrast);
    background: var(--test-e-primary);
}

.test-e-button-ghost {
    color: var(--test-e-primary);
    background: transparent;
    border-color: var(--test-e-primary);
}

.test-e-button-danger {
    background: transparent;
    color: var(--test-e-danger);
    border-color: rgba(248, 113, 113, 0.45);
}

.test-e-indexed,
.test-e-summary-section,
.test-e-tags,
.test-e-staff {
    border: 1px solid var(--test-e-border);
    border-radius: 14px;
    padding: 0.8rem;
}

.test-e-section-header h2,
.test-e-summary-section h2,
.test-e-tags h2,
.test-e-staff h2,
.test-e-related h2,
.test-e-report h2 {
    margin-top: 0;
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.test-e-section-header p {
    margin: 0;
    color: var(--test-e-muted);
    font-size: 0.9rem;
}

.test-e-grid {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.test-e-panel {
    border: 1px solid var(--test-e-border);
    border-radius: 12px;
    padding: 0.75rem;
}

.test-e-panel h3 {
    margin-top: 0;
    margin-bottom: 0.6rem;
}

.test-e-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.test-e-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.test-e-item-hidden {
    display: none;
}

.test-e-panel.is-expanded .test-e-item-hidden {
    display: flex;
}

.test-e-item-name {
    overflow-wrap: anywhere;
}

.test-e-item-meta {
    display: inline-flex;
    gap: 0.45rem;
    color: var(--test-e-muted);
    font-size: 0.82rem;
    align-items: center;
}

.test-e-pill {
    border: 1px solid var(--test-e-border);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    font-size: 0.68rem;
}

.test-e-more-wrap {
    margin-top: 0.6rem;
    display: grid;
    gap: 0.45rem;
}

.test-e-more-wrap p {
    margin: 0;
    color: var(--test-e-muted);
    font-size: 0.85rem;
}

.test-e-more-button {
    width: fit-content;
    background: transparent;
    border-color: var(--test-e-border);
    color: var(--test-e-text);
}

.test-e-empty {
    margin: 0;
    color: var(--test-e-muted);
}

.test-e-folder-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(148, 163, 184, 0.6);
}

.test-e-counts {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.test-e-counts div {
    border: 1px solid var(--test-e-border);
    border-radius: 12px;
    padding: 0.5rem;
}

.test-e-counts dt {
    margin: 0;
    font-size: 0.78rem;
    color: var(--test-e-muted);
}

.test-e-counts dd {
    margin: 0.2rem 0 0;
    font-weight: 700;
}

.test-e-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.test-e-tag {
    text-decoration: none;
    color: var(--test-e-text);
    border: 1px solid var(--test-e-border);
    background: var(--test-e-tag-bg);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.82rem;
}

.test-e-tag-muted {
    color: var(--test-e-muted);
}

.test-e-staff-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.test-e-feedback {
    margin: 0.45rem 0 0;
    color: var(--test-e-muted);
}

.test-e-related {
    margin-top: 1rem;
}

.test-e-related-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.test-e-related-list li {
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
}

.test-e-related-list a {
    color: var(--test-e-text);
}

.test-e-report {
    margin-top: 1rem;
}

.test-e-report-form {
    display: grid;
    gap: 0.45rem;
}

.test-e-report-form label {
    font-weight: 600;
    font-size: 0.9rem;
}

.test-e-report-form select,
.test-e-report-form textarea {
    border: 1px solid var(--test-e-border);
    border-radius: 10px;
    padding: 0.55rem;
    font: inherit;
    color: inherit;
    background: rgba(15, 23, 42, 0.72);
}

@media (min-width: 900px) {
    .test-e-page {
        padding-top: 1.5rem;
    }

    .test-e-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .test-e-metadata,
    .test-e-counts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
