@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

/* ── Variables (matches VelaHere site exactly) ─────────────────────────────── */
:root {
    --bg:          #0b1220;
    --bg-soft:     #111a2f;
    --surface:     #141f36;
    --surface2:    #192340;
    --text:        #e8eefc;
    --muted:       #9eabc8;
    --accent:      #82bcff;
    --accent-strong: #5ba6ff;
    --border:      #2a3b5d;
    --radius:      0.75rem;
    --radius-sm:   0.5rem;
    --sidebar-w:   240px;
    --topbar-h:    56px;
    --card-shadow: 0 8px 20px rgba(2,10,24,.2);
    --transition:  0.18s ease;

    --badge-release-bg:     rgba(59,130,246,.17);
    --badge-release-border: rgba(96,165,250,.4);
    --badge-release-text:   #bed9ff;
    --badge-update-bg:      rgba(16,185,129,.15);
    --badge-update-border:  rgba(52,211,153,.35);
    --badge-update-text:    #bef7e0;
    --badge-blog-bg:        rgba(148,163,184,.18);
    --badge-blog-border:    rgba(148,163,184,.38);
    --badge-blog-text:      #d5dfef;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: Inter, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── App shell ──────────────────────────────────────────────────────────────── */
#app-main {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: #0d1828;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 50;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--border);
}
.brand-logo-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg,#5ba6ff,#82bcff);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; font-weight: 900; color: #fff;
    flex-shrink: 0;
}
.brand-name { font-size: .95rem; font-weight: 700; letter-spacing: .03em; }

.sidebar-nav { flex: 1; padding: .75rem .65rem; }
.nav-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: .5rem .5rem .25rem;
    margin-top: .25rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    user-select: none;
    margin-bottom: .1rem;
}
.nav-item:hover { background: rgba(130,188,255,.08); color: var(--text); }
.nav-item.nav-active { background: rgba(91,166,255,.15); color: var(--accent); }
.nav-item.nav-active .nav-icon { filter: none; }
.nav-icon { font-size: 1rem; width: 1.15rem; text-align: center; }

.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid var(--border);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .6rem;
    border-radius: var(--radius-sm);
}
.sidebar-avatar {
    width: 28px; height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg,#5ba6ff,#82bcff);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.sidebar-username { font-size: .83rem; font-weight: 600; flex: 1; }
.logout-btn {
    padding: .35rem .55rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    color: var(--muted);
    transition: background var(--transition), color var(--transition);
}
.logout-btn:hover { background: rgba(248,113,113,.12); color: #fca5a5; }

/* ── Main content area ──────────────────────────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view-section {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 1200px;
    width: 100%;
}

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-title { font-size: 1.45rem; font-weight: 700; letter-spacing:-.02em; line-height:1.2; }
.page-sub   { font-size: .83rem; color: var(--muted); margin-top: .25rem; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent-strong);
    color: #051122;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(91,166,255,.25); }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { border-color: rgba(130,188,255,.45); color: var(--accent); }
.btn-danger { color: #fca5a5 !important; border-color: rgba(248,113,113,.35) !important; }
.btn-danger:hover { background: rgba(248,113,113,.1) !important; }

/* ── Stats grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: .5rem;
}
.stat-card {
    background: rgba(20,31,54,.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 3px 12px rgba(3,10,23,.16);
    transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(130,188,255,.3); }
.stat-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon-blue   { background: rgba(59,130,246,.15); }
.stat-icon-green  { background: rgba(16,185,129,.15); }
.stat-icon-amber  { background: rgba(251,191,36,.13); }
.stat-icon-purple { background: rgba(167,139,250,.15); }
.stat-value { font-size: 1.6rem; font-weight: 700; letter-spacing:-.02em; line-height:1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ── Section heading ────────────────────────────────────────────────────────── */
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .85rem; }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table-wrap {
    background: rgba(20,31,54,.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(3,10,23,.16);
}
.posts-table { width: 100%; border-collapse: collapse; }
.posts-table th {
    text-align: left;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: .65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(11,18,32,.4);
}
.posts-table td {
    padding: .7rem 1rem;
    font-size: .88rem;
    border-bottom: 1px solid rgba(42,59,93,.5);
    vertical-align: middle;
}
.post-row:last-child td { border-bottom: none; }
.post-row:hover td { background: rgba(130,188,255,.04); }

.post-icon-thumb {
    width: 32px; height: 32px; object-fit: cover;
    border-radius: 7px; border: 1px solid var(--border);
}
.post-icon-placeholder {
    width: 32px; height: 32px;
    border-radius: 7px;
    background: rgba(130,188,255,.12);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; color: var(--accent);
}
.post-title-cell { font-weight: 600; color: var(--text); }
.post-desc-cell  { font-size: .78rem; color: var(--muted); margin-top:.15rem; }
.post-date       { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: .18rem .58rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .72rem; font-weight: 700;
    white-space: nowrap;
}
.badge-blogs    { background: var(--badge-blog-bg);    border-color: var(--badge-blog-border);    color: var(--badge-blog-text); }
.badge-releases { background: var(--badge-release-bg); border-color: var(--badge-release-border); color: var(--badge-release-text); }
.badge-updates  { background: var(--badge-update-bg);  border-color: var(--badge-update-border);  color: var(--badge-update-text); }

.status-badge {
    display: inline-flex; align-items: center;
    padding: .18rem .58rem;
    border-radius: 999px;
    font-size: .72rem; font-weight: 700;
    border: 1px solid transparent;
}
.status-published { background: rgba(16,185,129,.15); border-color: rgba(52,211,153,.35); color: #bef7e0; }
.status-draft     { background: rgba(251,191,36,.12);  border-color: rgba(251,191,36,.3);  color: #fde68a; }

/* ── Post actions ───────────────────────────────────────────────────────────── */
.post-actions { display: flex; gap: .35rem; }
.action-btn {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
    transition: background var(--transition);
}
.action-btn:hover { background: rgba(130,188,255,.12); }
.action-btn-danger:hover { background: rgba(248,113,113,.15); }

/* ── Filter chips ───────────────────────────────────────────────────────────── */
.posts-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
    padding: .3rem .75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(17,27,48,.55);
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.chip:hover { border-color: rgba(130,188,255,.36); color: var(--text); }
.chip-active { background: var(--accent); color: #08162d; border-color: transparent; }

/* ── Search input ───────────────────────────────────────────────────────────── */
.search-input {
    padding: .45rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: .85rem;
    outline: none;
    min-width: 200px;
    transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.2rem;
}
.pg-btn {
    padding: .4rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-size: .82rem;
    font-weight: 600;
    transition: all var(--transition);
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn:disabled { opacity: .35; cursor: default; }
.pg-info { font-size: .82rem; color: var(--muted); }

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted);
}
.empty-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.empty-sub   { font-size: .85rem; }

/* ── Editor layout ──────────────────────────────────────────────────────────── */
#view-editor {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.ed-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(13,24,40,.96);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.ed-back {
    display: flex; align-items: center; gap: .3rem;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
    white-space: nowrap;
}
.ed-back:hover { color: var(--accent); }
.ed-title-input {
    flex: 1;
    min-width: 180px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    border-bottom: 1px solid transparent;
    padding: .2rem .3rem;
    transition: border-color var(--transition);
}
.ed-title-input:focus { border-color: var(--accent); }
.ed-topbar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Preview toggle */
.preview-toggle {
    display: flex; align-items: center; gap: .5rem;
    cursor: pointer;
    user-select: none;
}
.preview-toggle input { display: none; }
.toggle-track {
    width: 36px; height: 20px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    transition: background var(--transition);
}
.preview-toggle input:checked + .toggle-track { background: var(--accent-strong); }
.toggle-thumb {
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 999px;
    background: #fff;
    transition: left var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.preview-toggle input:checked + .toggle-track .toggle-thumb { left: 18px; }
.toggle-label { font-size: .82rem; font-weight: 600; color: var(--muted); }

/* Editor body */
.ed-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.ed-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

/* Toolbar */
.ed-toolbar {
    display: flex;
    align-items: center;
    gap: .1rem;
    padding: .4rem .75rem;
    border-bottom: 1px solid var(--border);
    background: rgba(11,18,32,.6);
    flex-wrap: wrap;
    flex-shrink: 0;
}
.ed-toolbar.tb-disabled { opacity: .4; pointer-events: none; }
.tb-group { display: flex; gap: .05rem; }
.tb-sep {
    width: 1px; height: 18px;
    background: var(--border);
    margin: 0 .35rem;
    align-self: center;
}
.tb-btn {
    padding: .28rem .45rem;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    transition: background var(--transition), color var(--transition);
    line-height: 1;
    white-space: nowrap;
}
.tb-btn:hover  { background: rgba(130,188,255,.1); color: var(--text); }
.tb-btn:active { background: rgba(130,188,255,.2); }
.tb-btn:disabled { opacity: .3; cursor: default; }
.tb-icon { font-size: .85rem; }

/* Content area */
.ed-content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.ed-textarea {
    width: 100%; height: 100%;
    padding: 1.1rem 1.25rem;
    background: #07101f;
    color: var(--text);
    border: none;
    outline: none;
    resize: none;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: .88rem;
    line-height: 1.75;
    tab-size: 2;
    overflow-y: auto;
}
.ed-textarea::placeholder { color: rgba(158,171,200,.4); }

.ed-preview {
    width: 100%; height: 100%;
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    background: #07101f;
}
.ed-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 1rem;
    font-size: .75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: rgba(11,18,32,.5);
    flex-shrink: 0;
}
.ed-save-status { font-style: italic; }

/* Right sidebar (front matter) */
.ed-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.ed-sidebar-scroll {
    overflow-y: auto;
    padding: 1rem .9rem;
    flex: 1;
}
.fm-section { margin-bottom: 1rem; }
.fm-label {
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-bottom: .35rem;
    display: block;
}
.fm-input {
    width: 100%;
    padding: .45rem .65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: .85rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}
.fm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(130,188,255,.1); }
.fm-textarea { resize: vertical; min-height: 68px; line-height: 1.5; }
.fm-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239eabc8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .65rem center;
    padding-right: 1.8rem;
    cursor: pointer;
}

/* Icon box */
.fm-icon-box { display: flex; gap: .6rem; align-items: flex-start; }
.fm-icon-preview {
    width: 64px; height: 64px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.fm-icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.fm-no-icon { font-size: .7rem; color: var(--muted); text-align: center; padding: .25rem; }
.fm-icon-actions { display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.fm-btn {
    display: block; width: 100%;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.fm-btn:hover { border-color: rgba(130,188,255,.4); color: var(--text); }
.fm-btn-danger:hover { border-color: rgba(248,113,113,.4); color: #fca5a5; }

/* Published toggle */
.fm-toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-switch { position: relative; cursor: pointer; }
.toggle-switch input { display: none; }
.ts-track {
    display: block;
    width: 40px; height: 22px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    transition: background var(--transition);
}
.toggle-switch input:checked + .ts-track { background: var(--accent-strong); }
.ts-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 999px;
    background: #fff;
    transition: left var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle-switch input:checked + .ts-track .ts-thumb { left: 21px; }

/* ── Media library ──────────────────────────────────────────────────────────── */
.media-controls { margin-bottom: 1.25rem; }
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 1.5rem;
    cursor: default;
}
.drop-zone-prominent { padding: 3rem 2rem; }
.drop-zone-over { border-color: var(--accent); background: rgba(130,188,255,.05); }
.drop-icon  { font-size: 2rem; margin-bottom: .5rem; }
.drop-title { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.drop-sub   { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.drop-hint  { font-size: .75rem; color: var(--muted); }
.drop-link  { color: var(--accent); cursor: pointer; font-weight: 600; }

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.media-item { display: flex; flex-direction: column; gap: .4rem; }
.media-thumb-wrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
}
.media-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-overlay {
    position: absolute; inset: 0;
    background: rgba(7,16,31,.88);
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: flex-end;
    padding: .6rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.media-thumb-wrap:hover .media-overlay { opacity: 1; }
.media-overlay-name { font-size: .72rem; font-weight: 600; color: var(--text); word-break: break-all; margin-bottom: .2rem; }
.media-overlay-size { font-size: .68rem; color: var(--muted); margin-bottom: .5rem; }
.media-overlay-actions { display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.moa-btn {
    width: 100%;
    padding: .3rem .45rem;
    border-radius: 5px;
    font-size: .72rem;
    font-weight: 600;
    background: rgba(255,255,255,.08);
    color: var(--text);
    transition: background var(--transition);
    text-align: left;
}
.moa-btn:hover { background: rgba(130,188,255,.15); }
.moa-btn-danger:hover { background: rgba(248,113,113,.2); color: #fca5a5; }
.media-meta { display: flex; justify-content: space-between; align-items: center; }
.media-name { font-size: .75rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
.media-size { font-size: .7rem; color: var(--muted); }
.media-empty-sm { color: var(--muted); font-size: .85rem; padding: 1rem; text-align: center; }

/* Media picker modal */
.media-pick-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.media-pick-modal {
    width: 100%; max-width: 580px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(2,10,24,.6);
}
.media-pick-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem; font-weight: 700;
}
.modal-close {
    width: 26px; height: 26px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: .85rem;
    transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: rgba(248,113,113,.15); color: #fca5a5; }
.media-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: .65rem;
    padding: 1rem;
    max-height: 380px;
    overflow-y: auto;
}
.mp-item {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}
.mp-item:hover { border-color: var(--accent); transform: scale(1.03); }
.mp-item img { width: 100%; height: 100%; object-fit: cover; }

/* ── Settings ───────────────────────────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}
.settings-card {
    background: rgba(20,31,54,.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(3,10,23,.16);
}
.settings-card-title {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(11,18,32,.3);
}
.settings-card-body { padding: 1rem; }
.settings-note { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.settings-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.settings-pass-error {
    margin-top: .5rem;
    padding: .45rem .65rem;
    border-radius: var(--radius-sm);
    background: rgba(248,113,113,.12);
    border: 1px solid rgba(248,113,113,.3);
    color: #fca5a5;
    font-size: .82rem;
}
.about-row {
    display: flex; justify-content: space-between;
    padding: .55rem 0;
    border-bottom: 1px solid rgba(42,59,93,.45);
    font-size: .85rem;
}
.about-row:last-child { border-bottom: none; }
.about-row span:first-child { color: var(--muted); }

/* ── Markdown preview ────────────────────────────────────────────────────────── */
.markdown-preview h1 { font-size: 1.7rem; margin: 0 0 1rem; letter-spacing:-.02em; }
.markdown-preview h2 { font-size: 1.3rem; margin: 1.8rem 0 .7rem; }
.markdown-preview h3 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
.markdown-preview p  { color: var(--muted); margin: 0 0 1rem; line-height: 1.75; }
.markdown-preview ul,.markdown-preview ol { color: var(--muted); padding-left: 1.4rem; margin: 0 0 1rem; }
.markdown-preview li + li { margin-top: .35rem; }
.markdown-preview blockquote {
    margin: 1.2rem 0;
    padding: .75rem 1rem;
    border-left: 3px solid var(--accent);
    background: rgba(17,27,48,.52);
    color: #d5e3ff;
    border-radius: .4rem;
}
.markdown-preview code {
    font-family: 'Menlo','Monaco',monospace;
    font-size: .88em;
    padding: .1rem .35rem;
    border-radius: .3rem;
    background: rgba(17,27,48,.82);
    border: 1px solid rgba(37,55,85,.78);
}
.markdown-preview pre {
    margin: 1.2rem 0;
    padding: .85rem 1rem;
    background: #0b1322;
    border: 1px solid var(--border);
    border-radius: .75rem;
    overflow-x: auto;
}
.markdown-preview pre code { padding: 0; border: none; background: none; }
.markdown-preview a { color: var(--accent); }
.markdown-preview img { max-width: 100%; border-radius: .6rem; margin: 1rem auto; }
.markdown-preview table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.markdown-preview th,.markdown-preview td { padding: .55rem .75rem; border: 1px solid var(--border); font-size: .88rem; }
.markdown-preview th { background: rgba(11,18,32,.5); color: var(--muted); font-weight: 700; }
.markdown-preview hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.markdown-preview input[type=checkbox] { margin-right: .4rem; }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    z-index: 1000;
    display: flex; flex-direction: column; gap: .5rem;
    pointer-events: none;
}
.toast {
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: none;
    max-width: 300px;
}
.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { background: rgba(16,185,129,.18); border-color: rgba(52,211,153,.35); color: #bef7e0; }
.toast-info    { background: rgba(59,130,246,.18); border-color: rgba(96,165,250,.4);  color: #bed9ff; }
.toast-error   { background: rgba(248,113,113,.15); border-color: rgba(248,113,113,.35); color: #fca5a5; }

/* ── Sidebar mobile overlay ─────────────────────────────────────────────────── */
#sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
    backdrop-filter: blur(2px);
}
#sidebarToggle {
    display: none;
    position: fixed;
    top: .75rem; left: .75rem;
    z-index: 60;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    align-items: center; justify-content: center;
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(42,59,93,.8); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(130,188,255,.3); }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-grid { grid-template-columns: 1fr; }
    .ed-sidebar { display: none; }
}
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.sidebar-open { transform: translateX(0); }
    #sidebarToggle { display: flex; }
    #main-content { margin-left: 0; }
    .view-section { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .ed-topbar { padding: .5rem .75rem; }
    .ed-title-input { font-size: .9rem; }
}
@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr; }
    .ed-sidebar { display: none; }
    .posts-controls { flex-direction: column; align-items: flex-start; }
    .search-input { min-width: unset; width: 100%; }
}

/* ── Loading state ──────────────────────────────────────────────────────────── */
.loading-state {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 3rem 1.5rem;
    color: var(--muted);
    font-size: .9rem;
}
.loading-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── fm-icon-path ────────────────────────────────────────────────────────────── */
.fm-icon-path {
    margin-top: .4rem;
    font-size: .7rem;
    color: var(--muted);
    word-break: break-all;
    font-family: monospace;
    background: var(--bg);
    padding: .25rem .4rem;
    border-radius: var(--radius-sm);
}

/* ── mp-name ─────────────────────────────────────────────────────────────────── */
.mp-name {
    font-size: .65rem;
    color: var(--muted);
    text-align: center;
    padding: .2rem .3rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   Jekyll Post Preview  (vp-* namespace — matches your actual site's post layout)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Wrapper — the preview pane already has overflow scroll */
#edPreview {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    background: #0e1a30;
}

.vp-post-main {
    max-width: 720px;
    margin: 0 auto;
    font-family: Inter, 'Segoe UI', sans-serif;
    color: #e8eefc;
    font-size: 15px;
    line-height: 1.7;
}

/* Back link */
.vp-back-link {
    margin-bottom: .75rem;
}
.vp-back-link a {
    color: #82bcff;
    font-size: .85rem;
    text-decoration: none;
    transition: opacity .15s;
}
.vp-back-link a:hover { opacity: .75; }

/* Category badge */
.vp-card-tag { margin-bottom: 1rem; }

.vp-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .2em .65em;
    border-radius: 99px;
    border: 1px solid;
}
.vp-badge--releases {
    background: rgba(59,130,246,.17);
    border-color: rgba(96,165,250,.4);
    color: #bed9ff;
}
.vp-badge--updates {
    background: rgba(16,185,129,.15);
    border-color: rgba(52,211,153,.35);
    color: #bef7e0;
}
.vp-badge--blogs {
    background: rgba(148,163,184,.18);
    border-color: rgba(148,163,184,.38);
    color: #d5dfef;
}

/* Download card */
.vp-download-card {
    background: #141f36;
    border: 1px solid #2a3b5d;
    border-radius: .75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.vp-download-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
    font-size: .75rem;
}
.vp-download-label {
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    color: #82bcff;
}
.vp-download-date { color: #9eabc8; }

.vp-download-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.vp-download-info { flex: 1; min-width: 0; }

.vp-download-info-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vp-download-project-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: .5rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #192340;
    border: 1px solid #2a3b5d;
}
.vp-download-project-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vp-download-info-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e8eefc;
    margin-bottom: .2rem;
}
.vp-download-info-text p,
.vp-download-info > p {
    font-size: .875rem;
    color: #9eabc8;
    margin: 0;
}
.vp-download-info > h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e8eefc;
    margin-bottom: .25rem;
}

.vp-download-action {
    display: inline-block;
    padding: .55rem 1.2rem;
    background: #82bcff;
    color: #0b1220;
    font-weight: 700;
    font-size: .85rem;
    border-radius: .5rem;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: background .15s;
}
.vp-download-action:hover { background: #5ba6ff; }

/* Post content */
.vp-post-content { padding-top: .5rem; }
.vp-post-content h1,
.vp-post-content h2,
.vp-post-content h3,
.vp-post-content h4 {
    color: #e8eefc;
    font-weight: 700;
    margin: 1.6rem 0 .6rem;
    line-height: 1.3;
}
.vp-post-content h1 { font-size: 1.7rem; }
.vp-post-content h2 { font-size: 1.3rem; }
.vp-post-content h3 { font-size: 1.1rem; }
.vp-post-content p  { margin: .75rem 0; color: #c8d5ed; }
.vp-post-content a  { color: #82bcff; text-decoration: underline; text-underline-offset: 3px; }
.vp-post-content strong { color: #e8eefc; font-weight: 700; }
.vp-post-content em { font-style: italic; }
.vp-post-content ul,
.vp-post-content ol {
    margin: .75rem 0 .75rem 1.5rem;
    color: #c8d5ed;
}
.vp-post-content li { margin: .3rem 0; }
.vp-post-content blockquote {
    border-left: 3px solid #82bcff;
    margin: 1rem 0;
    padding: .5rem 1rem;
    background: rgba(130,188,255,.06);
    border-radius: 0 .5rem .5rem 0;
    color: #9eabc8;
    font-style: italic;
}
.vp-post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(130,188,255,.1);
    color: #93c5fd;
    padding: .15em .4em;
    border-radius: 4px;
    font-size: .85em;
}
.vp-post-content pre {
    background: #0c1625;
    border: 1px solid #2a3b5d;
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}
.vp-post-content pre code {
    background: none;
    padding: 0;
    color: #c8d5ed;
    font-size: .85rem;
}
.vp-post-content hr {
    border: none;
    border-top: 1px solid #2a3b5d;
    margin: 1.5rem 0;
}
.vp-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: .875rem;
}
.vp-post-content th,
.vp-post-content td {
    border: 1px solid #2a3b5d;
    padding: .5rem .75rem;
    text-align: left;
}
.vp-post-content th {
    background: #192340;
    color: #e8eefc;
    font-weight: 600;
}
.vp-post-content td { color: #c8d5ed; }
.vp-post-content img {
    border-radius: .5rem;
    max-width: 100%;
    margin: 1rem auto;
}
.vp-post-content iframe {
    max-width: 100%;
    border-radius: .5rem;
    margin: 1rem 0;
}
