/* ==========================================================================
   Palette — warm, muted "dirt" tones on a dark background.
   ========================================================================== */
:root {
    --bg: #17130f;
    --bg-alt: #201a15;
    --bg-alt-2: #2a231b;
    --border: #3d342a;
    --text: #e9e0d2;
    --text-muted: #a89a86;
    --accent: #4d7ea8;
    --accent-hover: #6b9ac4;
    --danger: #b3503f;
    --danger-hover: #96412f;
    --success: #7a8c5a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a, a:visited, a:hover, a:active {
    text-decoration: none;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.wide-page main {
    max-width: none;
}

@media (max-width: 900px) {
    main {
        padding: 1.5rem;
    }
}

@media (max-width: 600px) {
    main {
        padding: 1rem;
    }
}

/* --- Header / footer --- */
header {
    background-color: var(--bg-alt);
    color: var(--text);
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.logo-wrap {
    position: relative;
    display: inline-block;
}

.logo-frame {
    display: inline-block;
    position: relative;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.logo-wrap:hover .logo-frame {
    transform: scale(1.15);
}

.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    animation: logo-sway 4s ease-in-out infinite;
}

.logo-wrap:hover .logo {
    animation-duration: 1.2s;
}

@keyframes logo-sway {
    0%, 100% { transform: translate(-50%, -50%) rotate(-5deg); }
    50% { transform: translate(-50%, -50%) rotate(5deg); }
}

.logo-bubble {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    padding: 0.4rem 0.75rem;
    background-color: var(--bg-alt-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform-origin: left top;
    transform: translateY(-4px) scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.logo-bubble::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 28px;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--bg-alt-2);
}

.logo-wrap:hover .logo-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: var(--accent-hover);
}

@media (max-width: 700px) {
    .site-nav {
        display: none;
    }
}

.design-notes-btn {
    margin-left: auto;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.design-notes-btn:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

@keyframes design-notes-btn-idle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes design-notes-btn-hover {
    0%, 100% { transform: translateY(0) scale(1.05); }
    50% { transform: translateY(-6px) scale(1.08); }
}

.scroll-glow {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 101px;
    background: linear-gradient(to top, rgba(107, 154, 196, 0.35), transparent);
    pointer-events: none;
    z-index: 500;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-glow-hidden {
    opacity: 0;
}

footer {
    background-color: var(--bg-alt);
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

.admin-link {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.admin-link:hover {
    color: var(--accent-hover);
}

/* --- Sections --- */
section {
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    scroll-margin-top: 80px;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

section.animate-in {
    opacity: 1;
}

#projects h2 {
    color: var(--text);
}

/* --- Home section --- */
#home {
    position: relative;
    overflow: visible;
}

#home::before {
    content: "";
    position: absolute;
    top: -8%;
    left: 50%;
    width: min(1000px, 150%);
    height: 560px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(77, 126, 168, 0.28) 0%, rgba(122, 78, 42, 0.12) 45%, transparent 72%);
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
}

.hero-title {
    max-width: 24ch;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
}

.hero-accent {
    color: var(--accent);
}

.hero-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background-color: var(--bg-alt-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tool-badge i {
    color: var(--accent);
    font-size: 0.9rem;
}

.tool-badge:hover {
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 5.5rem;
    margin-top: 1.5rem;
}

.home-text-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--accent);
}

.home-text-title::after,
.hero-description::after {
    content: "_";
    animation: blink-cursor 1s steps(1) infinite;
}

.hero-description {
    margin-top: 1.2rem;
    max-width: 65ch;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.home-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 3rem;
}

.home-video iframe {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.home-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.social-bubbles {
    display: flex;
    gap: 0.75rem;
}

.social-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--bg-alt-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-bubble:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #17130f;
    transform: translateY(-2px);
}

.home-design-notes-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    background-color: var(--accent);
    color: #17130f;
    font-weight: bold;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    animation: design-notes-btn-idle 2.5s ease-in-out infinite;
}

.home-design-notes-btn:hover {
    background-color: var(--accent-hover);
    animation: design-notes-btn-nervous 0.15s linear infinite;
}

@keyframes design-notes-btn-nervous {
    0% { transform: rotate(0deg) translateX(0); }
    25% { transform: rotate(-4deg) translateX(-2px); }
    50% { transform: rotate(0deg) translateX(0); }
    75% { transform: rotate(4deg) translateX(2px); }
    100% { transform: rotate(0deg) translateX(0); }
}

/* --- Projects section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-btn {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 0;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2;
    transition: background 0.3s ease;
}

.btn-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 3;
}

.service-btn img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    z-index: 1;
    opacity: 0.82;
    transition: opacity 0.3s ease;
}

.service-btn span {
    z-index: 4;
    position: relative;
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 3px 10px rgba(0,0,0,0.75), 0 0 24px rgba(0,0,0,0.55);
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

.service-btn:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.service-btn:hover::after {
    background: rgba(0, 0, 0, 0.6);
}

.service-btn:hover img {
    opacity: 0.5;
}

.service-btn:hover span {
    align-self: flex-start;
    margin-left: 1.5rem;
    margin-top: 1.2rem;
    margin-bottom: 0;
}

.service-btn .desc {
    display: none;
    color: #fff;
    font-size: 1rem;
    margin-top: 1.5rem;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    z-index: 3;
}

.service-btn:hover .desc {
    display: block;
}

#projects h2 {
    text-align: center;
}

#projects .btn-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem;
    text-align: center;
}

#projects .btn-content > span {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#projects .btn-content > span:not(.desc) {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    text-align: center;
}

#projects .service-btn:hover span {
    align-self: center;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
}

#projects .service-btn .desc {
    display: none;
    font-size: 0.95rem;
    margin-top: 0.35rem;
    line-height: 1.3;
}

#projects .service-btn:hover .desc {
    display: block;
}

/* --- Contact section --- */
#contact form {
    max-width: none;
    margin: 2rem 0 0 0;
    padding: 2rem 2rem 1.5rem 2rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

#contact label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
}

#contact input,
#contact textarea {
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-alt-2);
    color: var(--text);
    transition: border 0.2s;
}

#contact input:focus,
#contact textarea:focus {
    border-color: var(--accent);
    outline: none;
}

#contact button[type="submit"] {
    margin-top: 0.5rem;
    padding: 0.8rem 0;
    background: var(--accent);
    color: #17130f;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#contact button[type="submit"]:hover {
    background: var(--accent-hover);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.contact-status {
    margin-top: 0.5rem;
    font-weight: 600;
}

.contact-status-success {
    color: var(--success);
}

.contact-status-error {
    color: var(--danger);
}

/* --- Design Notes list --- */
.design-notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

#blog-search {
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-alt);
    color: var(--text);
    min-width: 220px;
    transition: border 0.2s;
}

#blog-search:focus {
    outline: none;
    border-color: var(--accent);
}

.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.blog-entry {
    display: flex;
    height: 180px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.blog-entry:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.blog-entry-image {
    flex: 0 0 auto;
    height: 100%;
    aspect-ratio: 16 / 9;
}

.blog-entry-image-blank {
    background: var(--bg-alt-2);
    border-right: 1px dashed var(--border);
}

.blog-entry-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-entry-content {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}

.blog-entry-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.blog-entry-tags .post-tag {
    font-size: 0.7rem;
}

.blog-entry-title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text);
}

.blog-entry-excerpt {
    margin: 0;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .blog-entry {
        flex-direction: column;
        height: auto;
    }

    .blog-entry-image {
        flex-basis: auto;
        height: 160px;
    }

    .blog-entry-content {
        flex-basis: auto;
    }
}

/* --- Blog post page --- */
.preview-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--accent);
    color: #17130f;
    font-weight: bold;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.preview-banner[hidden] {
    display: none;
}

.preview-back-btn {
    padding: 0.3rem 0.9rem;
    background: #17130f;
    color: var(--text);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.preview-back-btn:hover {
    background: var(--bg-alt-2);
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.post-tags {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-tag {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-hover);
}

.post-date {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.post-header-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.post-header-text {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

@media (max-width: 700px) {
    .post-header-row {
        flex-direction: column;
    }
}

.post-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 65ch;
}

.post-byline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.post-byline strong {
    color: var(--text);
}

.post-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.post-image-frame {
    width: 240px;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg-alt-2);
    border: 1px dashed var(--border);
}

#blog-entry-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 700px) {
    .post-image-frame {
        width: 100%;
    }
}

.post-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
    align-items: start;
}

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

.post-toc {
    position: sticky;
    top: 90px;
}

.post-toc-label {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.post-toc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    border-left: 1px solid var(--border);
}

.post-toc-link {
    display: block;
    padding: 0.1rem 0 0.1rem 0.9rem;
    margin-left: -1px;
    border-left: 1px solid transparent;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.post-toc-link:hover {
    color: var(--accent-hover);
    border-left-color: var(--accent);
}

.post-toc-h3 {
    padding-left: 1.6rem;
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .post-toc {
        position: static;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }
}

#blog-entry-body {
    font-family: 'Lora', Georgia, serif;
    min-width: 0;
}

#blog-entry-body img {
    max-width: 100%;
    border-radius: 6px;
}

#blog-entry-body h1,
#blog-entry-body h2,
#blog-entry-body h3 {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 1.2rem 0 0.6rem;
    scroll-margin-top: 90px;
}

#blog-entry-body p,
#blog-entry-body ul,
#blog-entry-body ol,
#blog-entry-body blockquote,
#blog-entry-body pre,
#blog-entry-body table {
    margin-bottom: 1rem;
}

#blog-entry-body ul,
#blog-entry-body ol {
    padding-left: 1.5rem;
}

#blog-entry-body blockquote {
    border-left: 4px solid var(--border);
    padding-left: 1rem;
    color: var(--text-muted);
}

#blog-entry-body a {
    color: var(--accent-hover);
    text-decoration: underline;
}

#blog-entry-body code {
    font-family: 'Courier New', monospace;
    background: var(--bg-alt-2);
    border: 1px solid var(--border);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

#blog-entry-body pre {
    background: var(--bg-alt-2);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

#blog-entry-body pre code {
    background: none;
    border: none;
    padding: 0;
}

#blog-entry-body table {
    border-collapse: collapse;
    width: 100%;
}

#blog-entry-body th,
#blog-entry-body td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.7rem;
    text-align: left;
}

/* --- Admin app --- */
#admin-login form,
#admin-panel form {
    max-width: 480px;
    margin: 1.5rem 0 0 0;
    padding: 2rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

#admin-login label,
#admin-panel label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text);
}

#admin-login input,
#admin-panel input,
#admin-panel textarea {
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-alt-2);
    color: var(--text);
    transition: border 0.2s;
}

#admin-login input:focus,
#admin-panel input:focus,
#admin-panel textarea:focus {
    border-color: var(--accent);
    outline: none;
}

#admin-login button,
#admin-panel button {
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: #17130f;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#admin-login button:hover,
#admin-panel button:hover {
    background: var(--accent-hover);
}

.admin-error {
    color: var(--danger);
    margin-top: 0.8rem;
    font-weight: 600;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.admin-save-status {
    color: var(--accent);
    font-weight: 600;
}

.admin-entry-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.admin-entry-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1rem;
    padding: 0.8rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.admin-entry-title {
    font-weight: 600;
    flex: 1 1 100%;
    color: var(--text);
}

.admin-entry-slug {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-entry-status {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.admin-entry-status-draft {
    background: var(--bg-alt-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.admin-entry-status-published {
    background: var(--accent);
    color: #17130f;
}

.admin-entries-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.admin-add-btn {
    margin-bottom: 0;
}

#adminEntrySearch {
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-alt);
    color: var(--text);
    min-width: 220px;
    transition: border 0.2s;
}

#adminEntrySearch:focus {
    outline: none;
    border-color: var(--accent);
}

#admin-editor-view form {
    max-width: none;
}

.admin-delete-btn {
    background: var(--danger) !important;
    color: #fff !important;
}

.admin-delete-btn:hover {
    background: var(--danger-hover) !important;
}

/* EasyMDE dark skin */
#admin-editor-view .EasyMDEContainer .CodeMirror {
    background: var(--bg-alt-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
}

#admin-editor-view .CodeMirror-cursor {
    border-left-color: var(--text);
}

#admin-editor-view .cm-s-easymde .cm-comment,
#admin-editor-view .cm-s-easymde .cm-link,
#admin-editor-view .cm-s-easymde .cm-url {
    color: var(--text-muted);
}

#admin-editor-view .CodeMirror-selected {
    background: rgba(193, 112, 63, 0.3);
}

#admin-editor-view .editor-toolbar {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

#admin-editor-view .editor-toolbar button {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: normal;
    cursor: pointer;
}

#admin-editor-view .editor-toolbar button:hover,
#admin-editor-view .editor-toolbar button.active {
    background: var(--bg-alt-2);
    border-color: var(--border);
    color: var(--text);
}

#admin-editor-view .editor-toolbar i.separator {
    border-left-color: var(--border);
    border-right-color: var(--bg-alt-2);
}

#admin-editor-view .editor-preview,
#admin-editor-view .editor-preview-side {
    background: var(--bg-alt-2);
    color: var(--text);
}

#admin-editor-view .editor-statusbar {
    color: var(--text-muted);
}
