@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/InterVariable-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    src: url('/static/fonts/InterVariable-cyrillic.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root,
[data-bs-theme="light"] {
    --t-primary: #4f46e5;
    --t-primary-hover: #4338ca;
    --t-primary-light: #eef2ff;
    --t-primary-rgb: 79, 70, 229;
    --t-text: #1a1a2e;
    --t-text-muted: #6b7280;
    --t-text-light: #9ca3af;
    --t-bg: #f8f9fa;
    --t-card-bg: #fff;
    --t-card-border: #e5e7eb;
    --t-card-hover: #c7d2fe;
    --t-nav-bg: #fff;
    --t-nav-text: #6b7280;
    --t-nav-text-hover: #4f46e5;
    --t-badge-public-bg: #d1fae5;
    --t-badge-public-text: #065f46;
    --t-badge-platform-bg: #dbeafe;
    --t-badge-platform-text: #1e40af;
    --t-badge-channel-bg: #fef3c7;
    --t-badge-channel-text: #92400e;
    --t-tier-bg: #faf5ff;
    --t-tier-border: #e9d5ff;
    --t-tier-price: #7c3aed;
    --t-code-bg: #f3f4f6;
    --t-pre-bg: #1e1e1e;
    --t-pre-text: #d4d4d4;
    --t-blockquote-border: #4f46e5;
    --t-locked-bg: #f8f9fa;
    --t-locked-border: #d1d5db;
    --t-input-bg: #fff;
    --t-input-border: #dee2e6;
    --t-input-text: #212529;
    --t-dropdown-bg: #fff;
    --t-dropdown-border: #dee2e6;
    --t-dropdown-hover: #f3f4f6;
    --t-shadow-sm: rgba(0,0,0,.04);
    --t-shadow-nav: rgba(0,0,0,.05);
    --t-footer-border: #e5e7eb;
    --t-alert-danger-bg: #fef2f2;
    --t-alert-danger-border: #fecaca;
    --t-alert-danger-text: #991b1b;
    --t-modal-bg: #fff;
    --t-btn-outline-border: #d1d5db;
    --t-btn-outline-text: #374151;
    --t-btn-outline-hover-bg: #f3f4f6;
    --t-btn-outline-hover-text: #1f2937;
    --t-form-label: #374151;
    --t-list-hover: #f3f4f6;
    --t-nav-username: #374151;
}

[data-bs-theme="dark"] {
    --t-primary: #818cf8;
    --t-primary-hover: #a5b4fc;
    --t-primary-light: #1e1b4b;
    --t-primary-rgb: 129, 140, 248;
    --t-text: #e5e7eb;
    --t-text-muted: #9ca3af;
    --t-text-light: #6b7280;
    --t-bg: #111827;
    --t-card-bg: #1f2937;
    --t-card-border: #374151;
    --t-card-hover: #4338ca;
    --t-nav-bg: #1f2937;
    --t-nav-text: #9ca3af;
    --t-nav-text-hover: #818cf8;
    --t-badge-public-bg: #064e3b;
    --t-badge-public-text: #6ee7b7;
    --t-badge-platform-bg: #1e3a5f;
    --t-badge-platform-text: #93c5fd;
    --t-badge-channel-bg: #78350f;
    --t-badge-channel-text: #fcd34d;
    --t-tier-bg: #1e1b4b;
    --t-tier-border: #4c1d95;
    --t-tier-price: #a78bfa;
    --t-code-bg: #374151;
    --t-pre-bg: #0d1117;
    --t-pre-text: #e6edf3;
    --t-blockquote-border: #818cf8;
    --t-locked-bg: #1f2937;
    --t-locked-border: #4b5563;
    --t-input-bg: #1f2937;
    --t-input-border: #4b5563;
    --t-input-text: #e5e7eb;
    --t-dropdown-bg: #1f2937;
    --t-dropdown-border: #4b5563;
    --t-dropdown-hover: #374151;
    --t-shadow-sm: rgba(0,0,0,.2);
    --t-shadow-nav: rgba(0,0,0,.3);
    --t-footer-border: #374151;
    --t-alert-danger-bg: #450a0a;
    --t-alert-danger-border: #7f1d1d;
    --t-alert-danger-text: #fca5a5;
    --t-modal-bg: #1f2937;
    --t-btn-outline-border: #4b5563;
    --t-btn-outline-text: #d1d5db;
    --t-btn-outline-hover-bg: #374151;
    --t-btn-outline-hover-text: #f3f4f6;
    --t-form-label: #d1d5db;
    --t-list-hover: #374151;
    --t-nav-username: #d1d5db;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--t-text);
    background: var(--t-bg);
    line-height: 1.6;
}

.navbar {
    background: var(--t-nav-bg);
    border-bottom: 1px solid var(--t-card-border);
    padding: .6rem 0;
    box-shadow: 0 1px 3px var(--t-shadow-nav);
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--t-primary) !important;
    letter-spacing: -.02em;
}

.navbar-brand .dot {
    color: var(--t-primary);
}

.navbar .nav-link {
    color: var(--t-nav-text) !important;
    font-size: .875rem;
    font-weight: 500;
    transition: color .15s;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--t-nav-text-hover) !important;
}

.nav-username {
    color: var(--t-nav-username);
    font-size: .85rem;
    font-weight: 500;
}

.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.btn-outline-secondary.btn-sm.dropdown-toggle {
    border-color: var(--t-primary);
    color: var(--t-primary);
    display: inline-flex;
    align-items: center;
    padding-top: .2rem;
    padding-bottom: .2rem;
    line-height: 1.2;
}

.btn-outline-secondary.btn-sm.dropdown-toggle:hover {
    background: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}

.btn-primary {
    background: var(--t-primary);
    border-color: var(--t-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--t-primary-hover);
    border-color: var(--t-primary-hover);
}

.btn-outline-secondary {
    border-color: var(--t-btn-outline-border);
    color: var(--t-btn-outline-text);
}

.btn-outline-secondary:hover {
    background: var(--t-btn-outline-hover-bg);
    border-color: var(--t-btn-outline-border);
    color: var(--t-btn-outline-hover-text);
}

.btn-outline-primary {
    border-color: var(--t-primary);
    color: var(--t-primary);
}

.btn-outline-primary:hover {
    background: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}

.card {
    border: 1px solid var(--t-card-border);
    border-radius: .5rem;
    box-shadow: 0 1px 3px var(--t-shadow-sm);
    transition: border-color .15s;
    background: var(--t-card-bg);
}

.card:hover {
    border-color: var(--t-card-hover);
}

.card h5 a {
    color: var(--t-text);
    text-decoration: none;
    font-weight: 600;
}

.card h5 a:hover {
    color: var(--t-primary);
}

.badge-public {
    background: var(--t-badge-public-bg) !important;
    color: var(--t-badge-public-text) !important;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-platform {
    background: var(--t-badge-platform-bg) !important;
    color: var(--t-badge-platform-text) !important;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-channel {
    background: var(--t-badge-channel-bg) !important;
    color: var(--t-badge-channel-text) !important;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.meta-info {
    font-size: .8rem;
    color: var(--t-text-light);
}

.meta-info a {
    color: var(--t-text-muted);
    font-weight: 500;
}

.meta-info a:hover {
    color: var(--t-primary);
}

.section-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--t-text-light);
    margin-bottom: .75rem;
}

.channel-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.tier-card {
    background: var(--t-tier-bg);
    border: 1px solid var(--t-tier-border);
    border-radius: .5rem;
    padding: 1rem;
}

.tier-card-summary {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.tier-name {
    font-weight: 600;
    color: var(--t-text);
}

.tier-price {
    color: var(--t-tier-price);
    font-weight: 700;
    font-size: .95rem;
}

.locked-content {
    background: var(--t-locked-bg);
    border: 1px dashed var(--t-locked-border);
    border-radius: .5rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--t-text-muted);
}

/* Paywall teaser — fades the preview text into the paywall card */
.teaser-preview {
    position: relative;
    max-height: 22rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

/* Compact teaser fade for feed cards — relies on server-side char limit for length;
   mask-image is purely aesthetic to signal the text continues. */
.teaser-preview-sm {
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, black 25%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 25%, transparent 100%);
}

/* Cover image wrapper — needed for the lock overlay */
.cover-wrapper {
    position: relative;
}

/* Semi-transparent lock overlay on locked-post covers */
.cover-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    pointer-events: none;
}

.cover-lock-overlay i {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

/* Paywall card shown below the teaser on the post page */
.paywall-card {
    background: var(--t-locked-bg);
    border: 1px dashed var(--t-locked-border);
    border-radius: .75rem;
    padding: 2rem 1.5rem;
    margin-top: 1.5rem;
    color: var(--t-text-muted);
}

.paywall-icon {
    font-size: 2rem;
    margin-bottom: .75rem;
    color: var(--t-text-light);
}

.paywall-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: .5rem;
    color: var(--t-text);
}

.paywall-subtitle {
    font-size: .9rem;
    margin-bottom: 1rem;
}

.locked-content .lock-icon {
    font-size: 1.5rem;
    margin-bottom: .5rem;
    color: var(--t-text-light);
}

.locked-content p {
    margin-bottom: .75rem;
    font-size: .9rem;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--t-text-muted);
}

.empty-state .empty-icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
    opacity: .5;
}

.article-content {
    line-height: 1.85;
    font-size: 1rem;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 1.75rem 0 .75rem;
    font-weight: 700;
}

.article-content code {
    background: var(--t-code-bg);
    padding: .15rem .4rem;
    border-radius: .25rem;
    font-size: .875em;
}

.article-content pre {
    background: var(--t-pre-bg);
    color: var(--t-pre-text);
    padding: 1rem;
    border-radius: .5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.article-content pre code {
    background: transparent;
    padding: 0;
}

.article-content blockquote {
    border-left: 3px solid var(--t-blockquote-border);
    padding-left: 1rem;
    color: var(--t-text-muted);
    margin: 1rem 0;
}

.article-content img {
    max-width: 100%;
    border-radius: .5rem;
}

.article-content p > img:only-child {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.breadcrumb {
    font-size: .85rem;
}

.breadcrumb a {
    color: var(--t-primary);
}

.form-label {
    font-weight: 500;
    font-size: .875rem;
    color: var(--t-form-label);
}

.form-control,
.form-select {
    background-color: var(--t-input-bg);
    border-color: var(--t-input-border);
    color: var(--t-input-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--t-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--t-primary-rgb), .15);
    background-color: var(--t-input-bg);
    color: var(--t-input-text);
}

footer {
    font-size: .8rem;
    color: var(--t-text-light);
    border-top: 1px solid var(--t-footer-border);
}

.alert-danger {
    background: var(--t-alert-danger-bg);
    border-color: var(--t-alert-danger-border);
    color: var(--t-alert-danger-text);
}

.list-group-item-action.active {
    background: var(--t-primary-light) !important;
    color: var(--t-primary) !important;
    font-weight: 600;
    border-color: transparent !important;
}

.list-group-item-action:not(.active):hover {
    background: var(--t-list-hover);
}

.cursor-pointer {
    cursor: pointer;
}

.dropdown-menu {
    background-color: var(--t-dropdown-bg);
    border-color: var(--t-dropdown-border);
}

.dropdown-item {
    color: var(--t-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--t-dropdown-hover);
    color: var(--t-text);
}

.dropdown-divider {
    border-color: var(--t-card-border);
}

.modal-content {
    background-color: var(--t-modal-bg);
    border-color: var(--t-card-border);
    color: var(--t-text);
}

.modal-header {
    border-color: var(--t-card-border);
}

.modal-footer {
    border-color: var(--t-card-border);
}

.btn-close {
    filter: var(--t-btn-close-filter, none);
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .navbar-toggler-icon {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--t-btn-outline-border);
    border-radius: .375rem;
    padding: .25rem .5rem;
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .25rem;
    transition: color .15s, border-color .15s;
}

.theme-toggle:hover {
    color: var(--t-primary);
    border-color: var(--t-primary);
}

.content-narrow {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}


.width-toggle {
    background: none;
    border: 1px solid var(--t-btn-outline-border);
    border-radius: .375rem;
    padding: .25rem .5rem;
    color: var(--t-text-muted);
    cursor: pointer;
    font-size: .75rem;
    line-height: 1.5;
    transition: color .15s, border-color .15s, background-color .15s;
}

.width-toggle:hover {
    color: var(--t-primary);
    border-color: var(--t-primary);
}

.width-toggle.width-toggle-active {
    background: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
    padding-right: .35rem;
}

.width-toggle.width-toggle-active:hover {
    opacity: .9;
    color: #fff;
}

.width-toggle-dismiss {
    display: inline-block;
    margin-left: .3rem;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1;
    opacity: .7;
    cursor: pointer;
    vertical-align: middle;
}

.width-toggle-dismiss:hover {
    opacity: 1;
}

.feed-cover-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: .5rem;
}

/* Wide mode: content-narrow class is removed by the width toggle JS.
   When no .content-narrow exists on the page, cap the feed cover height
   so it does not dominate the layout on wide monitors. */
html:not(:has(.content-narrow)) .feed-cover-image {
    max-height: 320px;
}

.post-cover-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: .5rem;
}

.channel-icon-lg {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--bs-border-color);
    flex-shrink: 0;
}

.channel-icon-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--bs-border-color);
}

.read-more-link {
    font-weight: 500;
    color: var(--bs-primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.read-more-link:hover {
    text-decoration: underline;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 1rem 0;
    border-radius: .5rem;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: .5rem;
    z-index: 1;
}

.video-embed.video-placeholder {
    padding-bottom: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--t-card-bg, #1a1a2e);
    border: 2px dashed var(--t-border-color, #dee2e6);
    padding: 3rem 1rem;
}

.video-embed.video-placeholder a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    color: var(--t-text-muted, #999);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color .2s;
}

.video-embed.video-placeholder a:hover {
    color: var(--t-primary, #7c5cfc);
}

.video-embed.video-placeholder svg {
    opacity: .6;
    transition: opacity .2s;
}

.video-embed.video-placeholder a:hover svg {
    opacity: 1;
}

.video-embed-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--t-card-bg, #f8f9fa);
    border: 1px solid var(--t-border-color, #dee2e6);
    border-radius: .5rem;
    z-index: 0;
    text-align: center;
    padding: 1rem;
    color: var(--t-text-muted);
}

.video-embed-fallback p {
    margin: 0 0 .5rem;
    color: var(--t-text-muted);
    font-size: .9rem;
}

.video-embed-fallback a {
    color: var(--t-primary);
    text-decoration: none;
    font-weight: 500;
}

.video-embed-fallback a:hover {
    text-decoration: underline;
}

.video-attribution {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .75rem;
    margin-top: .35rem;
    margin-bottom: .5rem;
    background: var(--t-card-bg, #f8f9fa);
    border: 1px solid var(--t-border-color, #dee2e6);
    border-radius: .375rem;
}

.video-attribution-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.video-attribution-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.video-attribution-title {
    font-size: .85rem;
    font-weight: 500;
    color: var(--t-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.video-attribution a {
    font-size: .8rem;
    color: var(--t-text-muted);
    text-decoration: none;
    line-height: 1.3;
}

.video-attribution a:hover {
    color: var(--t-primary);
    text-decoration: underline;
}

.char-counter {
    text-align: right;
    font-size: .75rem;
    color: var(--t-text-muted);
    margin-top: .25rem;
}

.char-counter-warning {
    color: #d97706;
}

.char-counter-danger {
    color: #dc2626;
    font-weight: 600;
}

.teaser-counter {
    text-align: right;
    font-size: .75rem;
    color: var(--t-text-muted);
    margin-top: .15rem;
}

.teaser-counter-warning {
    color: #d97706;
}

.teaser-counter-danger {
    color: #dc2626;
    font-weight: 600;
}

.teaser-counter-hint {
    color: var(--t-text-muted);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    font-size: .75rem;
}

.teaser-counter-hint:hover {
    color: var(--t-primary);
    text-decoration-style: solid;
}

.image-gallery-section {
    margin-top: 1rem;
}

.image-gallery-section h6 {
    margin-bottom: .5rem;
    font-weight: 600;
    font-size: .875rem;
    color: var(--t-text-light);
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.gallery-item {
    position: relative;
    width: 100px;
    border: 1px solid var(--t-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--t-bg-card);
    transition: box-shadow .15s;
}

.gallery-item:hover {
    box-shadow: 0 0 0 2px var(--t-primary);
}

.gallery-thumb {
    width: 100px;
    height: 80px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--t-bg-body);
}

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

.gallery-actions {
    display: flex;
    gap: 2px;
    padding: 3px;
    justify-content: center;
}

.gallery-actions .btn {
    padding: 1px 6px;
    font-size: .7rem;
    line-height: 1.3;
}

.gallery-empty {
    font-size: .85rem;
    margin: 0;
}

.gallery-item--cover-active {
    border-color: var(--t-primary);
    box-shadow: 0 0 0 2px var(--t-primary);
}

.gallery-cover-banner {
    font-size: .85rem;
}

.EasyMDEContainer .cm-image-marker + .cm-url + .cm-formatting + img {
    max-width: 100%;
    border-radius: 4px;
}

[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: var(--t-text-light);
}

[data-bs-theme="dark"] .breadcrumb-item.active {
    color: var(--t-text-muted);
}

[data-bs-theme="dark"] .text-muted {
    color: var(--t-text-muted) !important;
}

[data-bs-theme="dark"] .badge.bg-success {
    background-color: #065f46 !important;
    color: #6ee7b7 !important;
}

[data-bs-theme="dark"] .EasyMDEContainer .CodeMirror {
    background: var(--t-input-bg);
    color: var(--t-input-text);
    border-color: var(--t-input-border);
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-toolbar {
    border-color: var(--t-input-border);
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-toolbar button {
    color: var(--t-text-muted) !important;
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-toolbar button:hover,
[data-bs-theme="dark"] .EasyMDEContainer .editor-toolbar button.active {
    background: var(--t-dropdown-hover);
    color: var(--t-text) !important;
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-toolbar i.separator {
    border-color: var(--t-input-border);
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-preview {
    background: var(--t-card-bg);
    color: var(--t-text);
}

[data-bs-theme="dark"] .EasyMDEContainer .editor-preview-side {
    background: var(--t-card-bg);
    color: var(--t-text);
    border-color: var(--t-input-border);
}

[data-bs-theme="dark"] .EasyMDEContainer .CodeMirror-cursor {
    border-color: var(--t-text);
}

@media (max-width: 768px) {
    .channel-header h1 {
        font-size: 1.25rem;
    }

    main.container {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .card-body {
        padding: .875rem;
    }

    .tier-card:not(.tier-card-summary) {
        flex-direction: column;
        align-items: flex-start !important;
        gap: .5rem;
    }

    .tier-card-summary {
        flex-wrap: wrap;
    }

    .article-content pre {
        font-size: .8rem;
    }

    .table th, .table td {
        font-size: .8rem;
        padding: .5rem .4rem;
    }

    h2.fw-bold {
        font-size: 1.3rem;
    }

    .content-narrow {
        max-width: 100%;
    }
}

/* Tag chips */
.tag-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary);
    border: 1px solid var(--bs-border-color);
    transition: background 0.15s, color 0.15s;
}

.tag-chip:hover {
    background: var(--bs-secondary);
    color: #fff;
    border-color: var(--bs-secondary);
    text-decoration: none;
}

.tag-chip-active {
    background: var(--bs-secondary);
    color: #fff;
    border-color: var(--bs-secondary);
}

.tag-input-widget {
    background: var(--bs-body-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tag-input-widget:focus-within {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.tag-input-widget .tag-chip {
    padding: 0.1rem 0.45rem;
}
