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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    background: #f5f5f5;
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    margin-bottom: 2rem;
    color: #1a1a1a;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li[style*="--nested: true"] {
    padding-left: 3rem;
}

@supports (container-type: inline-size) {
    @container style(--nested: true) {
        li.main {
            display: grid;
            grid-template-columns: 3rem 3rem 1fr;
        }

        li.main .comment {
            grid-column: 1 / -1;
        }
    }
}

.comment {
    --size: 2.5rem;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.avatar {
    flex: 0 0 var(--size);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: #ddd;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment__wrapper {
    flex: 1;
    min-width: 0;
}

.comment__body {
    background: #fff;
    border-radius: 18px;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.comment__author {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    display: block;
}

.comment__text {
    color: #1a1a1a;
    font-size: 0.95rem;
    margin: 0;
    word-wrap: break-word;
}

.comment__meta {
    display: flex;
    gap: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    color: #65676b;
    align-items: center;
}

.comment__likes {
    font-weight: 600;
}

.comment__time {
    color: #8a8d91;
}

.comment__actions {
    display: flex;
    gap: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.comment__actions a {
    color: #65676b;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.comment__actions a:hover {
    color: #1a1a1a;
    text-decoration: underline;
}

.comment-replies {
    margin-top: 0.5rem;
}

.comment-replies .comment {
    --size: 2rem;
}

@supports (selector(:has(ul))) {
    li:has(ul) > .comment::before {
        content: "";
        position: absolute;
        left: calc(var(--size) / 2);
        top: calc(var(--size) + 0.5rem);
        bottom: 0;
        width: 2px;
        background: #e0e0e0;
    }
}

.comment__stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

.stat-badge {
    background: #e7f3ff;
    color: #1876f2;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.pinned-badge {
    background: #fff3cd;
    color: #856404;
}

.favorited-badge {
    background: #ffe7e7;
    color: #c41e3a;
}
