*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
    background: #f3f4f6;
    color: #1f2937;
    line-height: 1.7;
}

.widget-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 48px;
}

.back-link {
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.widget-article {
    margin-top: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.widget-article h1 {
    margin: 0 0 10px;
    line-height: 1.35;
}

.meta {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: 0.92rem;
}

.widget-article.short {
    max-width: 760px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.image-grid figure {
    margin: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.image-grid img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.image-grid figcaption {
    font-size: 0.85rem;
    color: #4b5563;
    padding: 8px 10px;
}

.two-column-layout {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.sidebar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    align-self: start;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.status-box {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

body.dark-theme {
    background: #0b1020;
    color: #e5e7eb;
}

body.dark-theme .widget-article {
    background: #151b2f;
    border-color: #2a3557;
    color: #e5e7eb;
}

body.dark-theme .meta {
    color: #9ca3af;
}

body.dark-theme .back-link {
    color: #93c5fd;
}

.mobile-narrow {
    max-width: 460px;
}

.mobile-frame {
    margin-top: 12px;
    width: 390px;
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 10px;
    background: #e5e7eb;
}

@media (max-width: 900px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}
