:root {
    --blue: #0a66c2;
    --ink: #172b4d;
    --muted: #68798d;
    --line: #d9e2ec;
    --surface: #fff;
    --canvas: #f3f6f8;
    --shadow: 0 2px 6px rgba(23, 43, 77, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
}

button,
input {
    font: inherit;
}

.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 800px;
    height: 100%;
    margin: 0 auto;
    padding: 0 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.brand img {
    display: block;
    width: auto;
    height: 38px;
    max-width: 100%;
    object-fit: contain;
}

.search {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    height: 38px;
    padding: 0 16px;
    color: var(--muted);
    background: #eef3f8;
    border-radius: 999px;
}

.search svg {
    flex: 0 0 auto;
}

.search input {
    width: 100%;
    margin-left: 9px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.search input::placeholder {
    color: #52677d;
}

.search input::-webkit-search-cancel-button {
    display: none;
}

.search-clear {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.search-clear:hover {
    color: var(--ink);
    background: #dee7f0;
}

.search input:placeholder-shown~.search-clear {
    display: none;
}

.comics-link {
    display: grid;
    flex: 0 0 auto;
    place-items: center end;
    width: 30px;
    height: 48px;
    color: var(--muted);
    border-radius: 50%;
}

.comics-link:hover {
    color: var(--blue);
    background: #eef6ff;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 64px;
}

.layout {
    display: block;
}

.panel,
.post-card,
.feed-heading {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.profile {
    overflow: hidden;
    text-align: center;
}

.profile-cover {
    height: 58px;
    background: linear-gradient(120deg, #0a66c2, #70b5f9);
}

.profile-logo {
    width: 64px;
    height: 64px;
    margin: -32px auto 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 50%;
    object-fit: contain;
}

.profile h1 {
    margin: 0 16px 5px;
    font-size: 16px;
}

.profile p {
    margin: 0 16px 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.profile-link {
    display: block;
    padding: 12px;
    color: var(--blue);
    border-top: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.feed-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 3px;
    padding: 14px 18px;
    border-radius: 0 0 8px 8px;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
}

.feed-heading h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 400;
}

.feed-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.feed {
    display: grid;
    gap: 14px;
}

.post-card {
    position: relative;
    overflow: hidden;
    animation: rise-in 360ms ease both;
}

.post-new-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: 60px;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
}

.post-new-ribbon span {
    position: absolute;
    top: 10px;
    right: -25px;
    width: 90px;
    padding: 3px 0;
    transform: rotate(45deg);
    color: #fff;
    background: linear-gradient(180deg, #ff7770 0%, #e92723 22%, #c61010 75%, #8e0808 100%);
    border-top: 1px solid #ffb1a9;
    border-bottom: 1px solid #920909;
    box-shadow: 0 2px 3px #0005;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 1px 1px #740000;
}

.post-card.is-new .post-meta {
    padding-right: 30px;
}

.post-main {
    padding: 18px 20px 15px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.post-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
}

.post-avatar img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.post-author {
    margin: 0;
    font-size: 14px;
}

.post-date {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.post-card h3 {
    margin: 0 0 7px;
    font-size: 18px;
    line-height: 1.3;
}

.post-card .summary {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: #394b5f;
    font-size: 14px;
    line-height: 1.45;
    cursor: pointer;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.post-card .summary:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.post-card .summary.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.post-card .summary:not(.is-expanded) + .post-image {
    margin-top: 12px;
}

.share-status:empty {
    display: none;
}

.share-stardust {
    position: fixed;
    width: 0;
    height: 0;
    z-index: 1000;
    pointer-events: none;
}

.share-stardust span {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
    opacity: 0;
    animation: share-stardust 1300ms ease-out both;
}

.share-stardust span:nth-child(3n + 1) {
    border-radius: 0;
    clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
}

@keyframes share-stardust {
    0% { opacity: 0; transform: translate(-2px, 0) scale(.3); }
    15% { opacity: 1; }
    45% { opacity: .55; transform: translate(calc(var(--x) * .65), var(--peak)) rotate(calc(var(--spin) * .5)) scale(1); }
    65% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), var(--end)) rotate(var(--spin)) scale(.15); }
}

.post-actions button.is-shared {
    color: #15804a;
    background: #eaf8f0;
}

@media (prefers-reduced-motion: reduce) {
    .share-stardust { display: none; }
    .share-stardust span { animation: none; }
}

.share-status {
    margin: 0;
    padding: 8px 20px;
    color: var(--muted);
    font-size: 13px;
}

.share-status input {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    user-select: text !important;
    -webkit-user-select: text !important;
}

.standalone-post .feed-heading,
.standalone-post .comics-link,
.standalone-post .search,
.standalone-post #scroll-sentinel {
    display: none;
}

.standalone-post .feed {
    margin-top: 16px;
}

.standalone-post .summary {
    cursor: auto;
}

.standalone-post .summary + .post-image {
    margin-top: 12px;
}

.post-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: linear-gradient(135deg, #d9efff, #70b5f9);
}

.post-video {
    margin-top: 12px;
    background: #000;
    border: 0;
}

.post-youtube {
    aspect-ratio: 16 / 9;
    min-height: 200px;
}

.post-image.is-placeholder {
    height: 180px;
    padding: 28px;
    object-fit: contain;
    background: linear-gradient(135deg, #d9efff, #70b5f9);
}

.post-actions {
    display: flex;
    gap: 3px;
    padding: 7px 12px;
    border-top: 1px solid var(--line);
}

.post-actions button {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 39px;
    padding: 8px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.post-actions button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-actions button.is-liked {
    color: #d0344b;
    background: #fff0f2;
}

.post-actions button.is-liked svg {
    fill: currentColor;
}

.post-actions button:disabled {
    opacity: .4;
    cursor: default;
}

.post-actions button:hover:not(:disabled) {
    color: var(--blue);
    background: #eef6ff;
}

.side-note {
    padding: 18px;
}

.side-note h2 {
    margin: 0 0 11px;
    font-size: 16px;
}

.side-note p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.side-note strong {
    color: var(--ink);
}

.status {
    padding: 24px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.loader {
    height: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 620px) {
    .topbar {
        height: auto;
        min-height: 62px;
    }

    .topbar-inner {
        align-items: center;
        gap: 6px;
        padding: 12px;
    }

    .search {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
    }

    main {
        padding: 0 12px 45px;
    }
}
