.blog-page, .blog-form { width: 100%; max-width: 860px; text-align: left; }

.blog-page > .backpagebutton,
.blog-form > .backpagebutton,
.post-hero > .backpagebutton { display: block; width: fit-content; margin-bottom: 18px; }

.blog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.blog-head h1 { margin: 0; }

.blog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; padding: 9px 16px; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn-primary { background-color: #47e3ff; color: #000; }
.btn-primary:hover { background-color: #25c1dd; }
.btn-ghost { background: transparent; color: #47e3ff; border: 1px solid #47e3ff; }
.btn-ghost:hover { background: rgba(71, 227, 255, 0.12); }
.btn-danger { background: transparent; color: #ff6b6b; border: 1px solid #ff6b6b; }
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); }

.post-list { display: flex; flex-direction: column; gap: 14px; width: 100%; margin: 22px 0; }
.post-card { position: relative; display: flex; align-items: flex-start; gap: 14px; text-align: left; background: #0d0d0d; border: 1px solid #222; border-radius: 12px; padding: 16px 20px; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.post-card:hover { border-color: #47e3ff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(71, 227, 255, 0.12); }
.post-card-main { flex: 1 1 auto; min-width: 0; display: block; text-decoration: none; color: inherit; }
.post-card .post-title { font-size: 1.2rem; font-weight: 700; color: #47e3ff; margin: 0 0 6px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .82rem; color: #99a3a8; }
.post-meta .dot { opacity: .5; }

.post-card-actions { flex: 0 0 auto; display: flex; align-items: center; }
.card-action { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: #9fb0b6; text-decoration: none; border: 1px solid #2c2c2c; border-radius: 8px; padding: 6px 12px; background: #111; transition: color .15s ease, border-color .15s ease, background .15s ease; white-space: nowrap; }
.card-action:hover { color: #47e3ff; border-color: #47e3ff; background: rgba(71, 227, 255, 0.1); }

.tagrow { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.tagchip { display: inline-block; font-size: .72rem; padding: 2px 10px; border-radius: 2rem; background: rgba(71, 227, 255, 0.1); color: #8fe9ff; border: 1px solid rgba(71, 227, 255, 0.25); }

.status-badge { display: inline-block; font-size: .72rem; padding: 2px 10px; border-radius: 2rem; font-weight: 600; }
.status-published { background: rgba(0, 255, 153, .12); color: #4dffb0; border: 1px solid rgba(0, 255, 153, .3); }
.status-draft { background: rgba(255, 255, 255, .07); color: #c0c0c0; border: 1px solid #444; }
.status-hidden { background: rgba(255, 178, 84, .12); color: #ffc16b; border: 1px solid rgba(255, 178, 84, .38); }

.meta-chip { display: inline-block; font-size: .72rem; padding: 2px 10px; border-radius: 2rem; background: rgba(255, 255, 255, .06); color: #b9c1c5; border: 1px solid #3a3a3a; }
.meta-chip.chip-members { background: rgba(180, 130, 255, .12); color: #cdb0ff; border-color: rgba(180, 130, 255, .35); }
.meta-dim { color: #8a949a; font-size: .82rem; }

.post-hero { width: 100%; max-width: 860px; text-align: left; margin: 6px 0 10px; }
.post-hero h1 { margin: 12px 0 14px; line-height: 1.2; }
.post-byline { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: #99a3a8; flex-wrap: wrap; }
.post-byline img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #333; }
.post-byline a { color: #47e3ff; font-weight: 600; text-decoration: none; }
.post-byline a:hover { text-decoration: underline; }

.author-hero { width: 100%; max-width: 860px; display: flex; align-items: center; gap: 20px; text-align: left; margin: 12px 0 6px; flex-wrap: wrap; }
.author-hero img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid #47e3ff; }
.author-hero h1 { margin: 0; }

.section-label { width: 100%; max-width: 860px; text-align: left; margin: 28px 0 2px; font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; color: #8a949a; }

.prose { width: 100%; max-width: 860px; text-align: left; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.6em; margin-bottom: .4em; line-height: 1.25; }
.prose p { margin: 1em 0; }
.prose a { color: #47e3ff; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1.2em auto; border-radius: 8px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .4em 0; }
.prose blockquote { border-left: 3px solid #47e3ff; margin: 1em 0; padding: .2em 1em; color: #cdd6da; background: rgba(71, 227, 255, .05); border-radius: 0 8px 8px 0; }
.prose pre { overflow: auto; border-radius: 8px; padding: 14px 16px; font-size: .9em; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.prose :not(pre) > code { background: rgba(255, 255, 255, .08); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.prose table { border-collapse: collapse; margin: 1em 0; }
.prose th, .prose td { border: 1px solid #333; padding: 8px 12px; text-align: left; }
.prose hr { border: none; border-top: 1px solid #333; margin: 1.6em 0; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }
.form-field > label, .form-label { font-weight: 600; font-size: .95rem; }
.form-hint { color: #889; font-weight: 400; font-size: .8rem; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-field { flex: 1 1 170px; margin: 8px 0; }
.blog-form input[type=text], .blog-form textarea, .blog-form select { background: #111; color: #fff; border: 1px solid #333; border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 15px; width: 100%; box-sizing: border-box; }
.blog-form textarea { min-height: 200px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; line-height: 1.5; resize: vertical; }
.blog-form textarea.autosize { resize: none; overflow: hidden; }
.blog-form input:focus, .blog-form textarea:focus, .blog-form select:focus { outline: none; border-color: #47e3ff; box-shadow: 0 0 0 3px rgba(71, 227, 255, .18); }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

.form-errors { background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .4); border-radius: 10px; padding: 12px 16px; margin: 14px 0; width: 100%; }
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors li { color: #ff9b9b; }

.callout { background: #0d0d0d; border: 1px solid #222; border-left: 3px solid #47e3ff; border-radius: 8px; padding: 14px 18px; margin: 16px 0; width: 100%; }

.empty-state { color: #889; padding: 26px; text-align: center; border: 1px dashed #333; border-radius: 12px; }

.editor-grid { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 0; }
.editor-col { flex: 1 1 380px; min-width: 280px; display: flex; flex-direction: column; }
.editor-col .editor-label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: #aeb6ba; }
.blog-form .editor-col textarea { min-height: 460px; }
#md-preview { box-sizing: border-box; border: 1px solid #2a2a2a; background: #0d0d0d; border-radius: 8px; padding: 14px 18px; min-height: 460px; overflow: auto; }
#md-preview:empty::before { content: 'Start typing to see a live preview\2026'; color: #5f6a6f; font-style: italic; }

.editor-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 4px; }
.editor-titlebar h1 { margin: 0; }
.editor-url-chip { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .8rem; color: #8fe9ff; background: rgba(71, 227, 255, .08); border: 1px solid rgba(71, 227, 255, .25); border-radius: 8px; padding: 5px 11px; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-url-chip:hover { background: rgba(71, 227, 255, .16); }

.editor-notice { display: flex; align-items: flex-start; gap: 11px; background: rgba(255, 178, 84, .08); border: 1px solid rgba(255, 178, 84, .35); border-radius: 10px; padding: 12px 16px; margin: 14px 0; color: #f0d6b4; line-height: 1.5; }
.editor-notice svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: #ffc16b; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.editor-notice strong { color: #ffd9a8; }

.editor-settings { background: #0b0b0b; border: 1px solid #1d1d1d; border-radius: 12px; padding: 2px 18px 16px; margin: 16px 0; }

.md-toolbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #0c0c0c; border: 1px solid #242424; border-radius: 10px; padding: 6px 10px; margin-bottom: 10px; }
.md-tools { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.md-tool { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 8px; background: transparent; color: #aeb6ba; border: 1px solid transparent; border-radius: 7px; font-family: inherit; font-size: 14px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.md-tool:hover { background: rgba(255, 255, 255, .07); color: #e8eef0; }
.md-tool:active { background: rgba(71, 227, 255, .14); color: #8fe9ff; }
.md-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.md-tool .md-b { font-weight: 800; font-size: 15px; }
.md-tool .md-i { font-style: italic; font-weight: 600; font-size: 15px; font-family: Georgia, "Times New Roman", serif; }
.md-divider { width: 1px; height: 20px; background: #2a2a2a; margin: 0 3px; }
.md-toolbar-right { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.word-count { font-size: .8rem; color: #8a949a; white-space: nowrap; }

.pane-toggle { display: none; border: 1px solid #242424; border-radius: 8px; overflow: hidden; }
.pane-btn { padding: 5px 13px; font-size: .82rem; font-weight: 600; color: #aeb6ba; background: #0c0c0c; border: none; cursor: pointer; font-family: inherit; }
.pane-btn + .pane-btn { border-left: 1px solid #242424; }
.pane-btn.active { background: rgba(71, 227, 255, .16); color: #8fe9ff; }

.preview-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: .82rem; font-weight: 600; font-family: inherit; color: #8fe9ff; background: rgba(71, 227, 255, .1); border: 1px solid rgba(71, 227, 255, .3); border-radius: 8px; cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.preview-switch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.preview-switch:hover { border-color: #47e3ff; }
.preview-switch[aria-pressed="false"] { color: #9fb0b6; background: transparent; border-color: #2f2f2f; }
.preview-switch[aria-pressed="false"]:hover { color: #e8eef0; border-color: #4a4a4a; }

.editor-actions-bar { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 14px 0 16px; background: rgba(0, 0, 0, .82); backdrop-filter: blur(6px); border-top: 1px solid #1c1c1c; }
.editor-actions-bar .spacer { margin-left: auto; }
.editor-hint { color: #6a7479; font-size: .8rem; }

@media (min-width: 761px) {
    .editor-grid.preview-off .editor-col--preview { display: none; }
    .editor-grid.preview-off .editor-col--write { flex-basis: 100%; }
}

@media (max-width: 760px) {
    .pane-toggle { display: inline-flex; }
    .preview-switch { display: none; }
    .editor-grid.show-write .editor-col--preview { display: none; }
    .editor-grid.show-preview .editor-col--write { display: none; }
}

.blog-modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); z-index: 10000; justify-content: center; align-items: center; padding: 20px; }
.blog-modal.active { display: flex; }
.blog-modal-box { background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 12px; padding: 24px; max-width: 440px; width: 100%; text-align: left; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); }
.blog-modal-box h3 { margin: 0 0 10px; }
.blog-modal-box p { margin: 0; color: #aeb6ba; line-height: 1.6; }
.blog-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.manage-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 6px; }
.manage-header h1 { margin: 0; }
.manage-sub { margin: 6px 0 0; color: #99a3a8; font-size: .95rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.manage-sub strong { color: #cdd6da; }
.manage-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.role-pill { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 9px; border-radius: 2rem; background: rgba(71, 227, 255, .12); color: #8fe9ff; border: 1px solid rgba(71, 227, 255, .3); }

.manage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px 18px; flex-wrap: wrap; margin: 20px 0 12px; padding-bottom: 14px; border-bottom: 1px solid #1c1c1c; }
.manage-toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.filter-group { display: inline-flex; gap: 4px; background: #0c0c0c; border: 1px solid #242424; border-radius: 10px; padding: 4px; flex-wrap: wrap; }
.filter-tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 7px; font-size: .88rem; font-weight: 600; color: #aeb6ba; text-decoration: none; transition: background .15s ease, color .15s ease; }
.filter-tab:hover { color: #e8eef0; background: rgba(255, 255, 255, .04); }
.filter-tab.active { background: #47e3ff; color: #002; }
.filter-count { font-size: .72rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 2rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); color: inherit; }
.filter-tab.active .filter-count { background: rgba(0, 0, 30, .18); }

.scope-toggle { display: inline-flex; border: 1px solid #242424; border-radius: 9px; overflow: hidden; }
.scope-btn { padding: 7px 14px; font-size: .85rem; font-weight: 600; color: #aeb6ba; text-decoration: none; background: #0c0c0c; transition: background .15s ease, color .15s ease; }
.scope-btn + .scope-btn { border-left: 1px solid #242424; }
.scope-btn:hover { color: #e8eef0; background: rgba(255, 255, 255, .04); }
.scope-btn.active { background: rgba(71, 227, 255, .14); color: #8fe9ff; }

.manage-search { display: inline-flex; align-items: center; gap: 8px; }
.manage-search input[type=search] { background: #111; color: #fff; border: 1px solid #333; border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 14px; width: 190px; max-width: 48vw; }
.manage-search input[type=search]:focus { outline: none; border-color: #47e3ff; box-shadow: 0 0 0 3px rgba(71, 227, 255, .18); }
.search-go { background: transparent; color: #47e3ff; border: 1px solid #47e3ff; border-radius: 8px; padding: 8px 14px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.search-go:hover { background: rgba(71, 227, 255, .12); }
.search-clear { color: #889; font-size: .82rem; text-decoration: none; }
.search-clear:hover { color: #ff9b9b; }

.manage-list { display: flex; flex-direction: column; width: 100%; margin: 4px 0 8px; border: 1px solid #1c1c1c; border-radius: 12px; overflow: hidden; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 14px 18px; flex-wrap: wrap; transition: background .15s ease; }
.manage-row + .manage-row { border-top: 1px solid #1c1c1c; }
.manage-row:hover { background: rgba(71, 227, 255, .04); }
.manage-row.row-hidden { background: rgba(255, 178, 84, .045); }
.manage-row.row-hidden:hover { background: rgba(255, 178, 84, .08); }
.manage-row-main { flex: 1 1 300px; min-width: 0; }
.manage-row-title { display: inline-block; color: #e8eef0; text-decoration: none; font-weight: 600; font-size: 1.02rem; margin-bottom: 7px; }
.manage-row-title:hover { color: #47e3ff; }
.manage-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }

.manage-row-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-inline-form { margin: 0; display: inline; }
.row-btn { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; color: #002; background: #47e3ff; border: 1px solid #47e3ff; border-radius: 7px; padding: 6px 13px; text-decoration: none; cursor: pointer; font-family: inherit; line-height: 1.2; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.row-btn:hover { background: #25c1dd; border-color: #25c1dd; }
.row-btn-ghost { background: transparent; color: #9fb0b6; border-color: #2f2f2f; }
.row-btn-ghost:hover { background: rgba(255, 255, 255, .05); color: #e8eef0; border-color: #4a4a4a; }
.row-btn-danger { background: transparent; color: #ff6b6b; border-color: rgba(255, 107, 107, .45); }
.row-btn-danger:hover { background: rgba(255, 107, 107, .12); border-color: #ff6b6b; }

.owner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin: 4px 0 18px; padding: 11px 16px; background: #0d0d0d; border: 1px solid #242424; border-radius: 10px; }
.owner-toolbar-status { display: inline-flex; align-items: center; gap: 8px; }
.owner-toolbar-label { color: #8a949a; font-size: .85rem; font-weight: 600; }
.owner-toolbar-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 560px) {
    .manage-row { align-items: flex-start; }
    .manage-row-actions { width: 100%; }
    .filter-group { width: 100%; justify-content: space-between; }
}
