:root {
    color-scheme: light;
    --postsrc-amber: #f59e0b;
    --postsrc-amber-dark: #b45309;
    --postsrc-ink: #27272a;
    --postsrc-muted: #71717a;
    --postsrc-line: #e4e4e7;
    --postsrc-surface: #ffffff;
    --postsrc-bg: #fffbeb;
}

html.dark {
    color-scheme: dark;
    --postsrc-ink: #f4f4f5;
    --postsrc-muted: #a1a1aa;
    --postsrc-line: #3f3f46;
    --postsrc-surface: #27272a;
    --postsrc-bg: #18181b;
}

* {
    box-sizing: border-box;
}

body.postsrc-body {
    margin: 0;
    min-width: 320px;
    color: var(--postsrc-ink);
    background-color: var(--postsrc-bg);
    background-image: url('/public/images/dots.svg');
    background-repeat: repeat;
}

.postsrc-header {
    border-bottom: 1px solid transparent;
    background: rgba(250, 250, 250, .96);
    transition: box-shadow .2s ease, border-color .2s ease;
    backdrop-filter: blur(10px);
}

.dark .postsrc-header {
    background: rgba(24, 24, 27, .96);
}

.postsrc-header.is-scrolled {
    border-color: var(--postsrc-line);
    box-shadow: 0 8px 24px rgba(39, 39, 42, .1);
}

.postsrc-logo-link,
.postsrc-footer-logo {
    display: inline-flex;
    align-items: center;
}

.postsrc-logo {
    display: block;
    width: 96px;
    height: auto;
}

.postsrc-logo-light {
    display: none;
}

.dark .postsrc-logo-dark {
    display: none;
}

.dark .postsrc-logo-light {
    display: block;
}

.postsrc-desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.postsrc-desktop-nav a,
.postsrc-mobile-nav a {
    color: #52525b;
    font-size: 1.125rem;
    font-weight: 650;
    text-decoration: none;
    text-underline-offset: 8px;
}

.dark .postsrc-desktop-nav a,
.dark .postsrc-mobile-nav a {
    color: #e4e4e7;
}

.postsrc-desktop-nav a:hover,
.postsrc-desktop-nav .postsrc-nav-active,
.postsrc-mobile-nav a:hover {
    color: var(--postsrc-amber-dark);
    text-decoration: underline;
}

.postsrc-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.postsrc-icon-button,
.postsrc-scroll-top,
.postsrc-search-heading button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 6px;
    color: var(--postsrc-amber-dark);
    background: transparent;
    cursor: pointer;
}

.postsrc-icon-button:hover,
.postsrc-search-heading button:hover {
    background: rgba(245, 158, 11, .12);
}

.postsrc-icon-button:focus-visible,
.postsrc-search-heading button:focus-visible,
.postsrc-scroll-top:focus-visible,
.postsrc-primary-button:focus-visible {
    outline: 3px solid rgba(245, 158, 11, .42);
    outline-offset: 2px;
}

.postsrc-account-icon {
    cursor: default;
}

.postsrc-account-icon:hover {
    background: transparent;
}

.postsrc-icon-button svg,
.postsrc-scroll-top svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.postsrc-menu-button {
    display: none;
}

.postsrc-mobile-nav {
    padding: 8px 16px 18px;
    flex-direction: column;
    gap: 12px;
}

.postsrc-mobile-nav:not([hidden]) {
    display: flex;
}

.postsrc-search[hidden] {
    display: none;
}

.postsrc-search {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    align-items: start;
    justify-items: center;
    padding: 9vh 16px 24px;
}

.postsrc-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 24, 27, .65);
    backdrop-filter: blur(4px);
}

.postsrc-search-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: 82vh;
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--postsrc-line);
    border-radius: 8px;
    background: var(--postsrc-surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.postsrc-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.postsrc-search-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.postsrc-search-heading button {
    font-size: 2rem;
    line-height: 1;
}

.postsrc-search input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--postsrc-line);
    border-radius: 6px;
    color: var(--postsrc-ink);
    background: var(--postsrc-surface);
    font: inherit;
}

.postsrc-search input:focus {
    border-color: var(--postsrc-amber);
    outline: 3px solid rgba(245, 158, 11, .2);
}

.postsrc-search-results {
    margin-top: 16px;
}

.postsrc-search-result {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid var(--postsrc-line);
    color: var(--postsrc-ink);
    text-decoration: none;
}

.postsrc-search-result strong,
.postsrc-search-result span {
    display: block;
}

.postsrc-search-result span {
    margin-top: 3px;
    color: var(--postsrc-muted);
    font-size: .86rem;
}

.postsrc-search-result:hover strong {
    color: var(--postsrc-amber-dark);
    text-decoration: underline;
}

.postsrc-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 80px;
    padding: 36px 16px 54px;
    text-align: center;
}

.postsrc-footer img {
    width: 104px;
    height: auto;
}

.postsrc-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
}

.postsrc-footer-social a,
.postsrc-footer-social span {
    color: var(--postsrc-muted);
    font-size: 1.125rem;
    font-weight: 650;
}

.postsrc-footer-lower {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.postsrc-footer-lower nav > * {
    color: var(--postsrc-muted);
    font-weight: 650;
}

.postsrc-footer-brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.postsrc-theme-control {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.postsrc-theme-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.postsrc-theme-control span {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d4d4d8;
    transition: background-color .2s ease;
}

.postsrc-theme-control span::after {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    content: '';
    transition: transform .2s ease;
}

.postsrc-theme-control input:checked + span {
    background: #f59e0b;
}

.postsrc-theme-control input:checked + span::after {
    transform: translateX(20px);
}

.postsrc-theme-control input:focus-visible + span {
    outline: 3px solid rgba(245, 158, 11, .42);
    outline-offset: 3px;
}

.postsrc-footer a {
    color: var(--postsrc-muted);
    text-decoration: none;
}

.postsrc-footer a:hover {
    color: var(--postsrc-amber-dark);
    text-decoration: underline;
}

.postsrc-footer p {
    margin: 0;
    color: var(--postsrc-muted);
    font-size: 1rem;
}

.postsrc-scroll-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    border: 1px solid var(--postsrc-line);
    color: var(--postsrc-ink);
    background: var(--postsrc-surface);
    box-shadow: 0 8px 24px rgba(39, 39, 42, .15);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.postsrc-scroll-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.postsrc-main,
body > main {
    min-height: 55vh;
}

body > main img {
    max-width: 100%;
    height: auto;
}

body > main pre {
    max-width: 100%;
    overflow-x: auto;
}

body > main article a,
body > main .prose a {
    color: #b45309;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dark body > main article a,
.dark body > main .prose a {
    color: #fcd34d;
}

.postsrc-content-notice {
    margin: 0 0 24px;
    padding: 16px 18px;
    border: 1px solid #f59e0b;
    border-left-width: 4px;
    border-radius: 8px;
    color: #78350f;
    background: #fffbeb;
}

.postsrc-content-notice strong {
    display: block;
    margin-bottom: 4px;
    color: #92400e;
}

.postsrc-content-notice p {
    margin: 0;
}

.dark .postsrc-content-notice {
    border-color: #b45309;
    color: #fef3c7;
    background: rgba(120, 53, 15, .35);
}

.dark .postsrc-content-notice strong {
    color: #fde68a;
}

.postsrc-readonly-comments {
    margin-top: 24px;
    padding: 12px 16px;
    border-left: 3px solid var(--postsrc-amber);
    color: var(--postsrc-muted);
    background: rgba(245, 158, 11, .08);
}

.postsrc-component-frame {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    border: 0;
    background: #fff;
    transition: width .2s ease;
}

[data-component-code][hidden],
.postsrc-component-frame[hidden] {
    display: none !important;
}

[data-component-action].is-active {
    background: #e4e4e7;
}

.dark [data-component-action].is-active {
    background: #18181b;
}

[data-component-action="copy"].is-copied {
    color: #047857;
    background: #d1fae5;
}

.postsrc-not-found {
    display: grid;
    min-height: 75vh;
    padding: 120px 16px 50px;
    place-items: center;
}

.postsrc-empty-state {
    width: min(620px, 100%);
    padding: 42px;
    border: 1px solid var(--postsrc-line);
    border-radius: 8px;
    background: var(--postsrc-surface);
    text-align: center;
}

.postsrc-empty-state h1 {
    margin: 4px 0 12px;
}

.postsrc-kicker {
    margin: 0;
    color: var(--postsrc-amber-dark);
    font-weight: 800;
}

.postsrc-primary-button {
    display: inline-flex;
    margin-top: 14px;
    padding: 10px 16px;
    border-radius: 6px;
    color: #18181b;
    background: #fbbf24;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .postsrc-desktop-nav {
        gap: .9rem;
    }

    .postsrc-desktop-nav a {
        font-size: .9rem;
    }
}

@media (max-width: 1023px) {
    .postsrc-desktop-nav {
        display: none;
    }

    .postsrc-menu-button {
        display: inline-grid;
    }
}

@media (max-width: 640px) {
    .postsrc-search {
        padding-top: 70px;
    }

    .postsrc-search-panel {
        padding: 18px;
    }

    .postsrc-empty-state {
        padding: 28px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
