/* 1. Design tokens */

:root {
    --ml-navy-900: #12142b;
    --ml-navy-800: #1b1e3c;
    --ml-navy-deep: #0c0e20;
    --ml-accent: #6d5ef4;
    --ml-accent-2: #38bdf8;
    --ml-gradient: linear-gradient(135deg, #6d5ef4, #38bdf8);
    --ml-button-gradient: linear-gradient(135deg, #5848d8, #087ea4);
    --ml-bg: #f6f7fb;
    --ml-surface: #ffffff;
    --ml-ink: #1f2333;
    --ml-muted: #6b7280;
    --ml-border: #e5e7f0;
    --ml-control-border: #858da0;
    --ml-radius: 10px;
    --ml-shadow: 0 2px 12px rgba(18, 20, 43, .07);
    --ml-shadow-hv: 0 6px 24px rgba(109, 94, 244, .14);
    --ml-font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Noto Sans SC", sans-serif;
    --ml-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ml-web: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%236d5ef4' stroke-width='0.6' opacity='0.5'%3E%3Cpath d='M50 50L50 2M50 50L85 15M50 50L98 50M50 50L85 85M50 50L50 98M50 50L15 85M50 50L2 50M50 50L15 15'/%3E%3Cpath d='M50 18Q67 24 82 39Q88 50 82 61Q67 76 50 82Q33 76 18 61Q12 50 18 39Q33 24 50 18Z'/%3E%3Cpath d='M50 32Q61 36 68 44Q71 50 68 56Q61 64 50 68Q39 64 32 56Q29 50 32 44Q39 36 50 32Z'/%3E%3Cpath d='M50 44Q55 46 57 50Q58 52 55 55Q52 57 50 56Q48 57 45 55Q42 52 43 50Q45 46 50 44Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* 2. General */

body {
    font: 14px/1.75 var(--ml-font);
    color: var(--ml-ink);
    background: var(--ml-bg);
    padding-top: 72px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--ml-font);
    font-weight: 700;
    color: var(--ml-ink);
    letter-spacing: -.01em;
}

a {
    color: var(--ml-accent);
    transition: color .15s ease;
}

a:hover,
a:focus {
    color: var(--ml-accent-2);
    text-decoration: none;
}

hr {
    border-top: 1px solid var(--ml-border);
}

code {
    font-family: var(--ml-mono);
    font-size: 85%;
    color: var(--ml-accent);
    background: #f0f0ff;
    border-radius: 4px;
}

pre {
    background: var(--ml-navy-900);
    color: #dbe1ff;
    border: 0;
    border-radius: var(--ml-radius);
    padding: 20px 24px;
}

pre code {
    color: inherit;
    background: transparent;
}

/* The editor splits code blocks into multiple <p><code> / <pre><code>
   fragments with injected <p>/<br>. Match direct .content > p:has(br)
   children as code lines and restore the dark monospace container */
@supports selector(:has(*)) {
    .content > p:has(br) {
        font-family: var(--ml-mono);
        font-size: 13px;
        line-height: 1.7;
        color: #dbe1ff;
        background: var(--ml-navy-900);
        border-left: 3px solid var(--ml-accent);
        border-radius: 0;
        margin: 0;
        padding: 6px 22px;
        white-space: pre-wrap;
        word-break: break-word;
    }

    /* Blank lines kept inside the reconstructed code block */
    .content > p:has(br) + p:not(:has(*)):has(+ p:has(br)) {
        background: var(--ml-navy-900);
        border-left: 3px solid var(--ml-accent);
        border-radius: 0;
        margin: 0;
        padding: 0 22px;
        line-height: 1.7;
    }

    /* Breathing room between code fragments and surrounding prose */
    .content > p:not(:has(br)):has(+ p:has(br)) {
        margin-bottom: 18px;
    }

    .content > p:has(br) + p:not(:has(br)) {
        margin-top: 18px;
    }

    .content > p:has(br) code {
        color: #a5b4ff;
        background: transparent;
        font-size: inherit;
        padding: 0;
    }

    /* Merge consecutive <pre> fragments into a single container */
    .content pre:has(+ pre) {
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .content pre + pre {
        margin-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
}

/* Editor-injected <p> inside <pre> must not break the monospace flow */
.content pre p {
    margin: 0;
    font: inherit;
    color: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 3. Navbar */

.navbar.navbar-inverse {
    background: var(--ml-navy-900);
    border: 0;
    border-radius: 0;
    min-height: 72px;
    margin-bottom: 0;
    box-shadow: 0 2px 16px rgba(18, 20, 43, .25);
}

.navbar.navbar-inverse::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ml-gradient);
}

.navbar.navbar-inverse .container {
    position: relative;
}

.navbar-inverse .navbar-nav > li {
    margin: 0 3px;
}

.navbar-inverse .navbar-nav > li > a {
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
    padding: 24px 16px;
    border-left: 0; /* Cancels ul.menus sidebar leakage from section 7, incl. its active purple bar */
    transition: color .15s ease;
}

.navbar-inverse .navbar-nav > li > a > i:first-child {
    margin-right: 7px;
}

.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
    color: #fff;
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--ml-accent);
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
    color: #fff;
    background: transparent;
    box-shadow: inset 0 -2px 0 var(--ml-accent-2);
}

.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
    background: var(--ml-navy-800);
    color: #fff;
}

.navbar-brand {
    padding: 20px 15px;
    height: 72px;
}

.ml-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.ml-brand:hover,
.ml-brand:focus {
    color: #fff;
}

.ml-brand .ml-web {
    color: var(--ml-accent-2);
    flex-shrink: 0;
}

.ml-brand .ml-brand-text {
    font-family: var(--ml-mono);
    font-size: 18px;
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1;
}

.ml-brand .ml-brand-text strong {
    font-weight: 700;
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.navbar-inverse .navbar-toggle {
    border: 0;
    margin-top: 19px;
    margin-bottom: 19px;
}

.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
    background: var(--ml-navy-800);
}

.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
    border-color: var(--ml-navy-800);
}

.navbar-inverse .dropdown-menu {
    background: var(--ml-navy-800);
    border: 0;
    border-radius: var(--ml-radius);
    box-shadow: 0 12px 32px rgba(12, 14, 32, .4);
    padding: 6px;
    margin-top: 4px;
}

/* Keep dropdowns in flow (visibility + opacity) so they fade in;
   the ::before diamond bridges the 4px gap to the navbar */
.navbar li.dropdown > .dropdown-menu {
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.navbar li.dropdown.open > .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: none;
}

.navbar li.dropdown > .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 24px;
    width: 9px;
    height: 9px;
    background: var(--ml-navy-800);
    border-radius: 2px;
    transform: rotate(45deg);
}

.navbar-right li.dropdown > .dropdown-menu::before {
    left: auto;
    right: 24px;
}

.navbar-inverse .dropdown-menu > li > a {
    color: rgba(255, 255, 255, .78);
    border-radius: 6px;
    padding: 8px 14px;
    border-left: 0;
}

/* Hover stays a neutral white veil so cursor feedback reads differently from the purple active state */
.navbar-inverse .dropdown-menu > li > a:hover,
.navbar-inverse .dropdown-menu > li > a:focus {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

/* Active dropdown items need explicit dark styling; otherwise ul.menus li.active
   from section 7 (same specificity, later in the file) leaks in:
   light-purple background plus a left purple bar */
.navbar-inverse .dropdown-menu > .active > a,
.navbar-inverse .dropdown-menu > .active > a:hover,
.navbar-inverse .dropdown-menu > .active > a:focus {
    background: rgba(109, 94, 244, .25);
    color: #fff;
    border-left: 0;
    font-weight: 600;
}

.navbar-inverse .dropdown-header {
    color: var(--ml-accent-2);
    font-family: var(--ml-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.navbar-inverse .dropdown-menu .divider {
    background: rgba(255, 255, 255, .08);
}

/* 4. Messages */

#messages .alert {
    background: var(--ml-surface);
    color: var(--ml-ink);
    border: 1px solid var(--ml-border);
    border-left: 3px solid var(--ml-accent);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

#messages .alert-danger,
#messages .alert-error {
    border-left-color: #ef4444;
}

#messages .alert-success {
    border-left-color: #22c55e;
}

#messages .alert-info {
    border-left-color: var(--ml-accent-2);
}

/* 5. Main / Content */

#content.frontend-main {
    min-height: 60vh;
    /* 36px bottom + the footer's 36px margin-top gives ~72px of separation;
       the previous 60+60 stack pushed the footer away from the content */
    padding: 40px 0 36px;
}

.ml-main {
    position: relative;
}

.page-container {
    position: relative;
}

/* Brand spider web: fixed page backdrop, decorative only */
body:not(.front) #content.frontend-main::after {
    content: "";
    position: fixed;
    right: 28px;
    top: 130px;
    width: 130px;
    height: 130px;
    background: var(--ml-web) no-repeat center / contain;
    opacity: .16;
    pointer-events: none;
    z-index: -1;
}

.page-header {
    border-bottom: 0;
    margin: 0 0 32px;
    padding-bottom: 0;
}

.page-header h1 {
    font-size: 30px;
    margin: 0 0 12px;
}

.page-header h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin-top: 12px;
    border-radius: 2px;
    background: var(--ml-gradient);
}

#left,
#right {
    position: relative;
}

/* 6. Post (blog) */

article.blog-list {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ml-border);
    border-radius: 0;
    box-shadow: none;
    padding: 8px 0 44px;
    margin-bottom: 44px;
}

article.blog-list:last-of-type {
    border-bottom: 0;
    margin-bottom: 24px;
}

article.blog-list.sticky {
    position: relative;
    padding-left: 28px;
}

article.blog-list.sticky::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 0;
    bottom: 44px;
    width: 3px;
    border-radius: 2px;
    background: var(--ml-gradient);
}

.blog-list .post-title {
    font-size: 26px;
    line-height: 1.3;
    margin: 0 0 16px;
}

.blog-list .post-title a {
    color: var(--ml-ink);
}

.blog-list .post-title a:hover {
    color: var(--ml-accent);
}

/* Promote badge, replacing the old bookmark.png bitmap */
.post-bookmark {
    display: inline-block;
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1;
}

.post-bookmark::before {
    content: "\f02e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--ml-accent);
}

/* Meta rows become flex: the old col-md-7 (~58% wide) wrapped the date onto
   a second line whenever the author name was long, so Page and Blog details
   looked different. display:contents drops the column box and lets author
   and date share the full row; taxonomy still sits right when present, and
   zeroed negative margins align the row with the body's left edge */
.row.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
    margin-left: 0;
    margin-right: 0;
}

.row.meta > .col-md-7 {
    display: contents;
}

.row.meta > .taxonomy {
    float: none;
    margin-left: auto;
}

.blog .meta {
    margin: 0 0 22px;
    border-bottom: 1px dashed var(--ml-border);
    padding-bottom: 14px;
}

.blog .meta .author,
.blog .meta .date-created {
    font-family: var(--ml-mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
    margin-right: 12px;
    white-space: nowrap;
}

.blog .meta .author a {
    color: var(--ml-muted);
}

.blog .meta .author a:hover {
    color: var(--ml-accent);
}

.blog .meta .author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.blog.teaser .blog-content {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.blog .taxonomy a,
.blog .tagcloud a,
.tagcloud a {
    display: inline-block;
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--ml-accent);
    background: #f0f0ff;
    border: 1px solid #e0ddff;
    border-radius: 999px;
    padding: 2px 10px;
    margin: 2px 4px 2px 0;
    transition: background .15s ease, color .15s ease;
}

.blog .tagcloud {
    margin-top: 20px;
}

.blog .taxonomy a:hover,
.blog .tagcloud a:hover,
.tagcloud a:hover {
    background: var(--ml-accent);
    border-color: var(--ml-accent);
    color: #fff;
}

/* Normalize Bootstrap nav-pills inside tagclouds so detail and tag pages share
   one pill style. Specificity beats .nav-pills > li.active > a */
.tagcloud .nav-pills {
    display: inline;
    margin: 0;
    padding: 0;
}

.tagcloud .nav-pills > li {
    display: inline-block;
    float: none;
}

.tagcloud .nav-pills > li > a {
    display: inline-block;
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--ml-accent);
    background: #f0f0ff;
    border: 1px solid #e0ddff;
    border-radius: 999px;
    padding: 2px 10px;
    margin: 2px 4px 2px 0;
    transition: background .15s ease, color .15s ease;
}

.tagcloud .nav-pills > li > a:hover,
.tagcloud .nav-pills > li.active > a,
.tagcloud .nav-pills > li.active > a:hover {
    background: var(--ml-accent);
    border-color: var(--ml-accent);
    color: #fff;
}

.blog .readmore a,
.blog-content .readmore a {
    font-weight: 600;
}

.blog .readmore a::after {
    content: " \2192";
}

/* Article detail typography */
.blog-page-wrapper .blog {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 32px 36px;
    margin-bottom: 32px;
}

.blog-page-wrapper .content {
    line-height: 1.8;
}

/* Body headings: match both .post-page-wrapper and .blog-page-wrapper and
   establish an h1(30) > h2(23) > h3(18) hierarchy */
.blog-page-wrapper .content h2,
.blog-page-wrapper .content h3,
.post-page-wrapper .content h2,
.post-page-wrapper .content h3 {
    margin-top: 36px;
    margin-bottom: 14px;
}

.blog-page-wrapper .content h2,
.post-page-wrapper .content h2 {
    font-size: 23px;
    letter-spacing: -.015em;
}

.blog-page-wrapper .content h3,
.post-page-wrapper .content h3 {
    font-size: 18px;
}

/* Body lists: themed bullets replace the default disc;
   :not([class]) keeps tagcloud nav-pills and other classed lists intact */
.content ul:not([class]),
.content ol:not([class]) {
    margin: 0 0 18px;
    line-height: 1.8;
}

.content ul:not([class]) {
    list-style: none;
    padding-left: 24px;
}

.content ul:not([class]) > li {
    position: relative;
    margin-bottom: 8px;
}

.content ul:not([class]) > li::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ml-accent);
}

.content ol:not([class]) {
    padding-left: 26px;
}

.content ol:not([class]) > li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.content ol:not([class]) > li::marker {
    color: var(--ml-accent);
    font-weight: 700;
    font-family: var(--ml-mono);
}

/* Inline body links get a subtle underline to separate them from heading and nav links */
.content p a {
    text-decoration: underline;
    text-decoration-color: rgba(109, 94, 244, .35);
    text-underline-offset: 2px;
}

.content p a:hover {
    text-decoration-color: var(--ml-accent-2);
}

.blog-page-wrapper .content img,
.post-page-wrapper .content img {
    border-radius: var(--ml-radius);
    max-width: 100%;
    height: auto;
}

blockquote {
    padding: 12px 24px;
    margin: 24px 0;
    font-size: 15px;
    color: var(--ml-muted);
    background: var(--ml-surface);
    border-left: 3px solid transparent;
    border-image: var(--ml-gradient) 1;
    border-radius: 0 var(--ml-radius) var(--ml-radius) 0;
}

.post-rss {
    color: var(--ml-accent);
}

/* Pages list: open editorial layout matching the blog list */
article.post-list {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--ml-border);
    border-radius: 0;
    box-shadow: none;
    padding: 8px 0 44px;
    margin-bottom: 44px;
}

article.post-list:last-of-type {
    border-bottom: 0;
    margin-bottom: 24px;
}

article.post-list.sticky {
    position: relative;
    padding-left: 28px;
}

article.post-list.sticky::before {
    content: "";
    position: absolute;
    top: 16px;
    left: 0;
    bottom: 44px;
    width: 3px;
    border-radius: 2px;
    background: var(--ml-gradient);
}

article.post-list .post-title {
    font-size: 26px;
    line-height: 1.3;
    margin: 0 0 16px;
}

article.post-list .post-title a {
    color: var(--ml-ink);
}

article.post-list .post-title a:hover {
    color: var(--ml-accent);
}

.post-meta {
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--ml-border);
}

.post-meta .post-created,
.post-meta .post-author {
    font-family: var(--ml-mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
    margin-right: 14px;
    white-space: nowrap;
}

.post-meta .post-created i,
.post-meta .post-author i {
    color: var(--ml-accent);
    margin-right: 6px;
}

.post-meta .post-author a {
    color: var(--ml-muted);
}

.post-meta .post-author a:hover {
    color: var(--ml-accent);
}

.post-entry .teaser {
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-tags .tagcloud {
    display: block;
    margin-top: 20px;
}

.post-entry .read-more {
    background: #f0f0ff;
    border-color: transparent;
    color: var(--ml-accent);
    font-weight: 600;
    border-radius: 999px;
    padding: 5px 16px;
}

.post-entry .read-more:hover,
.post-entry .read-more:focus {
    background: var(--ml-accent);
    color: #fff;
}

/* Page detail typography */
.page .meta {
    margin: 0 0 22px;
    border-bottom: 1px dashed var(--ml-border);
    padding-bottom: 14px;
}

.page .meta .author,
.page .meta .date-created {
    font-family: var(--ml-mono);
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
    margin-right: 12px;
    white-space: nowrap;
}

.page .meta .author a {
    color: var(--ml-muted);
}

.page .meta .author a:hover {
    color: var(--ml-accent);
}

.page .meta .author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.page .taxonomy a {
    display: inline-block;
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--ml-accent);
    background: #f0f0ff;
    border: 1px solid #e0ddff;
    border-radius: 999px;
    padding: 2px 10px;
    margin: 2px 4px 2px 0;
}

.page .taxonomy a:hover {
    background: var(--ml-accent);
    border-color: var(--ml-accent);
    color: #fff;
}

/* col-md-12 carries 15px side padding that no .row negative margin cancels
   here, which would shift the card right of the tab bar; zero it to realign */
.post-page-wrapper {
    padding-left: 0;
    padding-right: 0;
}

.post-page-wrapper .post-page {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 32px 36px;
    margin-bottom: 32px;
}

.post-page-wrapper .content {
    line-height: 1.8;
}

/* 7. Menus */

ul.menus {
    list-style: none;
    padding-left: 0;
}

/* Sidebar admin menus: reset Bootstrap's ul margin-bottom:10px, otherwise the
   gap under the last item exceeds the gap above the first. Scoped to
   .widget-menu so the top navbar's ul.menus keeps its navbar-nav margin */
.widget-menu ul.menus {
    margin: 0;
}

ul.menus li {
    margin: 0;
}

ul.menus li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ml-ink);
    border-left: 2px solid transparent;
    transition: background .15s ease;
}

ul.menus li a:hover {
    background: #f0f0ff;
    color: var(--ml-accent);
}

ul.menus li.active > a,
ul.menus li.active > a:hover {
    border-left-color: var(--ml-accent);
    background: #f0f0ff;
    color: var(--ml-accent);
    font-weight: 600;
}

ul.menus li.children a {
    padding-left: 24px;
    font-size: 13px;
}

/* Sidebar admin menus: space and vertically center icons. Scoped to
   .widget-menu; leading icons are direct <a> > i children while the collapse
   arrow lives in a <span>, so it stays untouched. fa-fw keeps the text column
   aligned and gap supplies the spacing */
.widget-menu ul.menus li a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-menu ul.menus li a > i {
    flex: none;
}

.widget-menu ul.menus li a > span {
    flex: 1 1 auto;
}

/* Hidden submenus left in flow push #content-body down 16px: their clearfix
   clears below the floated col-md-9 (view pages 40px vs edit pages 24px).
   Take them out of flow, anchored to the relatively positioned li */
.widget-menu ul.menus li {
    position: relative;
}

.widget-menu ul.menus li > ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 4px 0;
}

/* 8. Widgets / Panels */

/* Sidebar panels: the view-page MANAGEMENT widget (.panel and .widget are the
   same element) plus edit-page Publication/Category/Comments panels.
   The old descendant selector `.widget .panel` never matched on a single
   element, so Bootstrap's native 4px/#ddd/grey-header style stayed visible */
.panel.widget,
#side-info-column .panel {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    margin-bottom: 24px;
}

/* Strip Bootstrap's blue panel-info header so it matches panel-default */
.panel.widget > .panel-heading,
#side-info-column .panel > .panel-heading {
    background: transparent;
    color: var(--ml-ink);
    border-bottom: 1px solid var(--ml-border);
    border-radius: calc(var(--ml-radius) - 1px) calc(var(--ml-radius) - 1px) 0 0;
    padding: 14px 20px 10px;
}

.panel.widget .panel-title,
.panel.widget .panel-title a,
#side-info-column .panel-title,
#side-info-column .panel-title a {
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

.panel.widget .panel-title::after,
#side-info-column .panel-title::after {
    content: "";
    display: block;
    width: 32px;
    height: 2px;
    margin-top: 8px;
    border-radius: 1px;
    background: var(--ml-gradient);
}

.panel.widget .panel-body,
#side-info-column .panel-body {
    padding: 16px 20px;
}

.panel.widget .list-group-item {
    border-color: var(--ml-border);
    background: transparent;
}

/* 9. Comments */

.list-comments {
    margin-top: 40px;
}

.list-comments h4.title {
    font-size: 18px;
    margin-bottom: 20px;
}

ol.comments {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

ol.comments li.comment {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 20px 24px;
    margin-bottom: 16px;
}

ol.comments li.comment.pending,
ol.comments li.comment.published.pending {
    border-style: dashed;
    border-color: #f59e0b;
    background: #fffdf5;
}

ol.comments .author.thumbnail {
    display: block;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
}

/* Comment rows become flex with a fixed 64px avatar column; in narrow
   containers col-sm-1 is only ~28px and the thumbnail's max-width:100%
   squashes the 48px avatar into a vertical ellipse */
ol.comments li.comment .row {
    display: flex;
    align-items: flex-start;
}

ol.comments li.comment .row > .col-sm-1 {
    flex: 0 0 64px;
    width: 64px;
}

ol.comments li.comment .row > .col-sm-11 {
    flex: 1 1 auto;
    width: auto;
}

ol.comments .author.thumbnail img {
    width: 48px;
    height: 48px;
    max-width: none;
    border-radius: 50%;
}

ol.comments .data {
    font-size: 13px;
    margin-bottom: 8px;
}

ol.comments .data a {
    font-weight: 600;
    color: var(--ml-ink);
}

ol.comments .data .date-created {
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
    margin-left: 10px;
}

ol.comments .comment-content {
    color: var(--ml-ink);
    line-height: 1.7;
}

ol.comments .edit a,
ol.comments .delete a {
    color: var(--ml-muted);
    margin-left: 8px;
}

ol.comments .delete a:hover {
    color: #ef4444;
}

.blog-comment-form-wrapper,
.post-comment-form-wrapper {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 28px 32px;
    margin-top: 32px;
}

/* 10. Misc (buttons, pagination, forms) */

#tabs-actions {
    margin-bottom: 24px;
}

/* Tabs restyled as pills in the button family: Bootstrap's white active tab
   with a connecting bottom border clashes with the grey-page/white-card
   surface. Inactive matches .btn-default, active uses the brand gradient
   like .btn-primary, at a uniform 38px height */
#tabs .nav-tabs {
    border-bottom: 0;
}

#tabs .nav-tabs > li {
    margin-right: 8px;
}

#tabs .nav-tabs > li > a {
    margin: 0;
    padding: 8px 16px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: 8px;
    color: var(--ml-ink);
    font-weight: 600;
    transition: box-shadow .15s ease, border-color .15s ease, color .15s ease;
}

#tabs .nav-tabs > li > a:hover,
#tabs .nav-tabs > li > a:focus {
    background: var(--ml-surface);
    border-color: var(--ml-accent);
    color: var(--ml-accent);
}

#tabs .nav-tabs > li.active > a,
#tabs .nav-tabs > li.active > a:hover,
#tabs .nav-tabs > li.active > a:focus {
    background: var(--ml-gradient);
    border: 1px solid transparent;
    color: #fff;
    box-shadow: var(--ml-shadow-hv);
}

/* A BFC blocks child margin collapse; otherwise the view page's
   .list-comments 40px top margin escapes #content-body and merges with
   #tabs-actions' bottom margin, making the tab gap 40px instead of the
   edit page's 24px */
#content-body.with-tabs {
    display: flow-root;
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 18px;
    transition: box-shadow .15s ease, transform .15s ease;
}

/* Size variants share .btn specificity and override its generic padding by source order */
.btn-lg {
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 10px;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-xs {
    padding: 1px 8px;
    font-size: 12px;
    border-radius: 5px;
}

.btn-primary,
.btn-success {
    background: var(--ml-button-gradient);
    border: 1px solid transparent;
    color: #fff;
}

.btn-primary:hover,
.btn-success:hover,
.btn-primary:focus,
.btn-success:focus {
    color: #fff;
    box-shadow: var(--ml-shadow-hv);
}

.btn-default {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    color: var(--ml-ink);
}

.btn-default:hover {
    border-color: var(--ml-accent);
    color: var(--ml-accent);
}

.btn-danger {
    background: #e5484d;
    border-color: #e5484d;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #d0383e;
    border-color: #d0383e;
    color: #fff;
}

.ml-confirm-card {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 32px 36px;
}

.ml-confirm-text {
    font-size: 16px;
    margin-bottom: 6px;
}

.ml-confirm-note {
    color: var(--ml-muted);
    margin-bottom: 24px;
}

/* Core views emit .form-actions-right but only the cerber theme defines it;
   muffetlab adds it so blog/page/comment/register primary buttons align right,
   matching the Contact form's pull-right */
.form-actions-right {
    text-align: right;
}

.ml-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

p.pagination,
.pagination {
    margin-top: 32px;
}

p.pagination a,
p.pagination span,
p.pagination strong {
    display: inline-block;
    min-width: 36px;
    padding: 7px 14px;
    margin: 0 3px;
    text-align: center;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: 999px;
    color: var(--ml-ink);
    font-size: 13px;
    transition: border-color .15s ease, color .15s ease;
}

p.pagination a:hover {
    border-color: var(--ml-accent);
    color: var(--ml-accent);
}

p.pagination strong,
p.pagination strong:hover {
    background: var(--ml-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

.form-control {
    min-height: 44px;
    height: auto;
    border: 1px solid var(--ml-control-border);
    border-radius: 8px;
    box-shadow: none;
    padding: 8px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus {
    border-color: var(--ml-accent);
    box-shadow: 0 0 0 3px rgba(109, 94, 244, .15);
}

/* Shared caret for native selects that keep the browser's option popup.
   Add .select-caret to any select.form-control that needs the theme arrow.
   !important keeps it consistent inside more specific page-level rules. */
.select-caret {
    appearance: none !important;
    line-height: 20px !important;
    padding-right: 40px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236d5ef4' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 10px 6px !important;
}

.input-group-addon {
    padding: 10px 14px;
    background: #f8f7ff;
    border: 1px solid var(--ml-control-border);
    border-radius: 8px 0 0 8px;
    color: var(--ml-accent);
}

.input-group-addon + .form-control {
    border-radius: 0 8px 8px 0;
}

.control-label.required::after {
    content: " *";
    color: #dc2626;
}

.has-error .help-block {
    color: #dc2626;
}

.widget-user-login .btn {
    min-height: 44px;
}

/* Blog/page edit form labels match the contact form typography */
.blog-form .control-label,
.blog-form label.wrap,
.post-form .control-label,
.post-form label.wrap {
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ml-muted);
}

.blog-form .has-error .control-label,
.blog-form .has-error label.wrap,
.post-form .has-error .control-label,
.post-form .has-error label.wrap {
    color: #dc2626;
}

/* Keep the site URL in its own casing inside the uppercase Permalink label */
.blog-form .permalink-url,
.post-form .permalink-url {
    text-transform: none;
}

/* TinyMCE container follows the form-control tokens. The oxide skin is
   injected after theme.css at runtime, so overrides carry a body prefix. */
body .tox-tinymce {
    border: 1px solid var(--ml-control-border);
    border-radius: 8px;
}

body .tox-tinymce.tox-edit-focus {
    border-color: var(--ml-accent);
    box-shadow: 0 0 0 3px rgba(109, 94, 244, .15);
}

/* Neutralize the skin's blue inner focus overlay */
body .tox-tinymce.tox-edit-focus .tox-edit-area::before {
    opacity: 0;
}

body .tox-tinymce .tox-statusbar {
    border-top: 1px solid var(--ml-border);
}

/* Publication panel footer: drop Bootstrap's grey strip (#f5f5f5/#ddd) so the card stays white */
#side-info-column .panel-footer {
    background: transparent;
    border-top: 1px solid var(--ml-border);
    border-radius: 0 0 calc(var(--ml-radius) - 1px) calc(var(--ml-radius) - 1px);
    padding: 14px 20px;
}

/* The sidebar is only ~173px wide, so Trash(154px) and Save(70px) never fit
   on one row. Stack instead: full-width Save as the primary action on top,
   Move to Trash demoted to a ghost danger text link below */
.blog-form #major-publishing-actions,
.post-form #major-publishing-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0;
}

.blog-form #publishing-action,
.post-form #publishing-action {
    order: -1;
    margin-left: 0;
}

.blog-form #publishing-action .btn,
.post-form #publishing-action .btn {
    width: 100%;
}

/* Move to Trash: the btn-default chip becomes a ghost danger link.
   Note #delete-action is itself the .btn, so the old `.btn .fa-trash-can`
   descendant selector never matched */
.blog-form #delete-action,
.post-form #delete-action {
    align-self: flex-start;
    background: transparent;
    border-color: transparent;
    color: #e5484d;
    padding: 6px 8px;
    border-radius: 6px;
}

.blog-form #delete-action:hover,
.blog-form #delete-action:focus,
.post-form #delete-action:hover,
.post-form #delete-action:focus {
    background: rgba(229, 72, 77, .08);
    border-color: transparent;
    color: #c92f34;
}

.blog-form #delete-action .fa-trash-can,
.post-form #delete-action .fa-trash-can {
    margin-right: 6px;
}

/* Radio group fieldsets (Discussion) reset Bootstrap's fieldset/legend defaults */
.blog-form fieldset,
.post-form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.blog-form legend,
.post-form legend {
    display: block;
    width: auto;
    max-width: none;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    line-height: 1.5;
}

/* Sticky/Promote checkboxes and Discussion radios keep the native control but
   drop Bootstrap's negative margin + 20px label padding. */
.blog-form .controls.checkbox,
.blog-form .controls.radio,
.post-form .controls.checkbox,
.post-form .controls.radio {
    display: inline-flex;
    align-items: center;
    min-height: 0;
    margin: 0 24px 0 0;
    padding: 0;
    border: 0;
}

.blog-form .controls.checkbox label,
.blog-form .controls.radio label,
.post-form .controls.checkbox label,
.post-form .controls.radio label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    min-height: 0;
    line-height: 1.4;
    cursor: pointer;
}

.blog-form .controls.checkbox label input,
.blog-form .controls.radio label input,
.post-form .controls.checkbox label input,
.post-form .controls.radio label input {
    position: static;
    float: none;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--ml-accent);
    cursor: pointer;
}

.blog-form .controls.checkbox label:hover,
.blog-form .controls.radio label:hover,
.post-form .controls.checkbox label:hover,
.post-form .controls.radio label:hover {
    color: var(--ml-accent);
}

.blog-form .controls.checkbox label:has(input:checked),
.blog-form .controls.radio label:has(input:checked),
.post-form .controls.checkbox label:has(input:checked),
.post-form .controls.radio label:has(input:checked) {
    color: var(--ml-accent);
    font-weight: 600;
}

.blog-form .controls.checkbox + .controls.checkbox,
.blog-form .controls.radio + .controls.radio,
.post-form .controls.checkbox + .controls.checkbox,
.post-form .controls.radio + .controls.radio {
    margin-top: 10px;
}

.breadcrumb {
    background: transparent;
    border: 1px solid var(--ml-border);
    border-radius: 999px;
    padding: 8px 18px;
    margin-bottom: 24px;
}

.table > thead > tr > th {
    border-bottom: 2px solid var(--ml-accent);
    font-family: var(--ml-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.table > tbody > tr > td {
    border-color: var(--ml-border);
}

/* Bare tables in body content (no .table class, no thead, th in the first row) */
.content table {
    width: 100%;
    margin: 0 0 24px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    overflow: hidden;
}

.content table th {
    background: var(--ml-navy-900);
    color: #dbe1ff;
    font-family: var(--ml-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left;
    padding: 12px 16px;
}

.content table th code {
    color: #a5b4ff;
    background: transparent;
    padding: 0;
    font-size: inherit;
    text-transform: none;
}

.content table td {
    padding: 11px 16px;
    border-top: 1px solid var(--ml-border);
    color: var(--ml-ink);
}

.content table tbody tr:nth-child(even) td {
    background: #fafbfd;
}

.content table td code {
    color: var(--ml-accent);
    background: #f0f0ff;
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12.5px;
}

.well {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
}

#footer-system-info small {
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .04em;
}

/* 11. Footer */

footer.footer {
    background: var(--ml-navy-900);
    color: rgba(255, 255, 255, .6);
    margin-top: 36px;
    padding: 0;
    border: 0;
}

footer.footer .extra {
    padding: 48px 0 32px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.footer-block h4 {
    color: #fff;
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.footer-block h4::after {
    content: "";
    display: block;
    width: 28px;
    height: 2px;
    margin-top: 8px;
    border-radius: 1px;
    background: var(--ml-gradient);
}

.footer-block a,
footer.footer a {
    color: rgba(255, 255, 255, .6);
}

.footer-block a:hover,
footer.footer a:hover {
    color: var(--ml-accent-2);
}

.footer-block-content ul {
    list-style: none;
    padding-left: 0;
}

.footer-block-content ul a {
    display: block;
    padding: 3px 0;
}

.footer-terms {
    background: var(--ml-navy-deep);
    padding: 20px 0;
    font-size: 13px;
}

.footer-terms p {
    margin: 6px 0;
}

.footer-terms .text-muted,
.footer-terms #footer-system-info {
    color: rgba(255, 255, 255, .35);
}

/* 12. Welcome (front page) */

.welcome-main {
    padding-top: 0;
}

.ml-hero {
    position: relative;
    background: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, var(--ml-navy-900), var(--ml-navy-800) 65%, #232a63);
    color: #fff;
    padding: 110px 0 120px;
    overflow: hidden;
}

.ml-hero .container {
    position: relative;
}

.ml-hero-web {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: min(460px, 42vw);
    height: auto;
    opacity: .55;
    pointer-events: none;
}

.ml-hero-web .ml-web-spokes path,
.ml-hero-web .ml-web-rings path {
    stroke-opacity: .3;
    transition: stroke-opacity .8s ease;
}

.ml-hero:hover .ml-hero-web .ml-web-spokes path,
.ml-hero:hover .ml-hero-web .ml-web-rings path {
    stroke-opacity: .5;
}

.ml-hero-web .ml-web-sweep {
    transform-box: view-box;
    transform-origin: 50% 50%;
    animation: ml-web-sweep 28s linear infinite;
}

.ml-hero-web .ml-web-core {
    transform-box: view-box;
    transform-origin: 50% 50%;
    animation: ml-web-breathe 4.5s ease-in-out infinite;
}

@keyframes ml-web-sweep {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ml-web-breathe {
    0%, 100% {
        transform: scale(1);
        opacity: .7;
    }
    50% {
        transform: scale(1.45);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ml-hero-web .ml-web-sweep,
    .ml-hero-web .ml-web-core {
        animation: none;
    }

    .ml-hero-web .ml-web-spokes path,
    .ml-hero-web .ml-web-rings path {
        transition: none;
    }
}

.ml-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ml-gradient);
}

.ml-hero h1.ml-hero-title {
    font-size: 48px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
    margin: 0 0 20px;
    line-height: 1.15;
}

.ml-hero h1.ml-hero-title .ml-hero-accent {
    background: var(--ml-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ml-hero .ml-hero-lead {
    font-size: 18px;
    color: rgba(255, 255, 255, .72);
    max-width: 620px;
    margin-bottom: 36px;
}

.ml-hero .ml-hero-kicker {
    display: inline-block;
    font-family: var(--ml-mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ml-accent-2);
    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: 999px;
    padding: 5px 14px;
    margin-bottom: 24px;
}

.ml-hero .btn-ml-primary {
    background: var(--ml-gradient);
    border: 0;
    color: #fff;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: 999px;
    margin-right: 12px;
}

.ml-hero .btn-ml-primary:hover,
.ml-hero .btn-ml-primary:focus {
    color: #fff;
    box-shadow: 0 8px 28px rgba(109, 94, 244, .45);
    transform: translateY(-1px);
}

.ml-hero .btn-ml-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .3);
    color: rgba(255, 255, 255, .85);
    font-size: 15px;
    padding: 12px 28px;
    border-radius: 999px;
}

.ml-hero .btn-ml-ghost:hover,
.ml-hero .btn-ml-ghost:focus {
    border-color: var(--ml-accent-2);
    color: #fff;
}

.ml-features {
    padding: 72px 0 40px;
}

.ml-feature-card {
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    padding: 32px 28px;
    margin-bottom: 28px;
    height: 100%;
    transition: box-shadow .2s ease, transform .2s ease;
}

.ml-feature-card:hover {
    box-shadow: var(--ml-shadow-hv);
    transform: translateY(-3px);
}

.ml-feature-card .ml-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #f0f0ff;
    color: var(--ml-accent);
    font-size: 22px;
    margin-bottom: 18px;
}

/* Feature cards are fully clickable; the link keeps the plain text color */
a.ml-feature-card {
    display: block;
    color: var(--ml-ink);
    text-decoration: none;
}

a.ml-feature-card:hover,
a.ml-feature-card:focus {
    color: var(--ml-ink);
    text-decoration: none;
}

.ml-feature-meta {
    display: block;
    font-family: var(--ml-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ml-muted);
    margin-bottom: 6px;
}

.ml-feature-hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ml-accent);
}

.ml-feature-hint i {
    font-size: 11px;
    transition: transform .15s ease;
}

a.ml-feature-card:hover .ml-feature-hint i {
    transform: translateX(4px);
}

.ml-feature-card h3 {
    font-size: 17px;
    margin: 0 0 10px;
}

.ml-feature-card p {
    color: var(--ml-muted);
    font-size: 14px;
    margin: 0;
}

.ml-blog-cta {
    text-align: center;
    padding: 24px 0 80px;
}

.ml-blog-cta .btn-ml-primary {
    background: var(--ml-gradient);
    border: 0;
    color: #fff;
    padding: 11px 30px;
    border-radius: 999px;
}

.ml-blog-cta .btn-ml-primary:hover {
    color: #fff;
    box-shadow: var(--ml-shadow-hv);
}

/* 13. Contact */

body.Contact-mail #content-body {
    position: relative;
}

/* Contact intro: standalone info card; the web icon and corner texture echo the brand */
body.Contact-mail .help {
    position: relative;
    margin: 0 0 20px;
    padding: 24px 28px 24px 66px;
    background: linear-gradient(120deg, #fff, #f3f1ff);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    overflow: hidden;
}

body.Contact-mail .help::before {
    content: "";
    position: absolute;
    top: 27px;
    left: 24px;
    width: 24px;
    height: 24px;
    background: var(--ml-web) no-repeat center / contain;
}

body.Contact-mail .help::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -38px;
    width: 160px;
    height: 160px;
    background: var(--ml-web) no-repeat center / contain;
    opacity: .08;
    pointer-events: none;
}

body.Contact-mail .help p {
    margin: 0;
    color: var(--ml-muted);
    line-height: 1.8;
}

/* Form card: core contact/form.php markup stays untouched; only theme CSS re-lays it out */
body.Contact-mail #contact-form {
    position: relative;
    margin: 0;
    padding: 32px 36px 28px;
    background: var(--ml-surface);
    border: 1px solid var(--ml-border);
    border-radius: var(--ml-radius);
    box-shadow: var(--ml-shadow);
    overflow: hidden;
}

body.Contact-mail #contact-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ml-gradient);
}

body.Contact-mail #contact-form > .col-sm-12 {
    width: 100%;
    padding: 0;
    float: none;
}

body.Contact-mail #contact-form .form-group {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 0 0 22px;
}

body.Contact-mail #contact-form .control-label {
    float: none;
    flex: 0 0 130px;
    width: 130px;
    padding: 10px 0 0;
    margin: 0;
    font-family: var(--ml-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ml-muted);
}

body.Contact-mail #contact-form .form-group > .col-sm-9 {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 0;
}

body.Contact-mail #contact-form .col-sm-9 > .row {
    display: block;
    margin: 0;
}

body.Contact-mail #contact-form .input-group {
    display: block;
    float: none;
    width: 100%;
    max-width: none;
    padding: 0;
}

body.Contact-mail #contact-form .form-control {
    min-height: 44px;
    height: auto;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fcfcfe;
    color: var(--ml-ink);
}

body.Contact-mail #contact-form textarea.form-control {
    height: auto;
    min-height: 168px;
    padding: 12px 14px;
    line-height: 1.7;
    resize: vertical;
}

body.Contact-mail #contact-form .charleft.help-block {
    clear: both;
    margin: 0;
    padding-top: 9px;
    font-family: var(--ml-mono);
    font-size: 11px;
    letter-spacing: .03em;
    color: var(--ml-muted);
}

body.Contact-mail #contact-form .charleft.help-block.text-warning {
    color: #b45309;
}

/* Guest captcha area uses a dashed panel; real markup is .row > .captcha-field + .help-block */
body.Contact-mail #contact-form .form-group:has(.captcha) {
    padding: 18px 20px;
    background: #f8f7ff;
    border: 1px dashed #d8d2ff;
    border-radius: var(--ml-radius);
}

body.Contact-mail #contact-form .col-sm-9 > .row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

body.Contact-mail #contact-form .captcha-field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

body.Contact-mail #contact-form .captcha-field .form-control {
    flex: 0 1 210px;
    min-width: 140px;
    max-width: none;
    width: auto;
}

body.Contact-mail #contact-form .captcha-image {
    display: inline-flex;
    flex: 0 0 auto;
}

body.Contact-mail #contact-form .captcha-image img {
    display: block;
    width: auto;
    height: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

body.Contact-mail #contact-form .has-error .control-label {
    color: #dc2626;
}

body.Contact-mail #contact-form .has-error .form-control {
    background: #fffafa;
    border-color: #ef4444;
}

body.Contact-mail #contact-form .has-error .form-control:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

body.Contact-mail #contact-form > .form-group {
    display: block;
    clear: both;
    margin: 26px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--ml-border);
}

body.Contact-mail #contact-form > .form-group > .col-sm-12 {
    padding: 0;
}

body.Contact-mail #contact-form .btn-success {
    min-width: 164px;
    padding: 11px 24px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(109, 94, 244, .22);
}

body.Contact-mail #contact-form .btn-success:hover,
body.Contact-mail #contact-form .btn-success:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(109, 94, 244, .3);
}

/* 14. Responsive */

@media (max-width: 991px) {
    .ml-hero {
        padding: 80px 0 90px;
        background-size: 22px 22px, auto;
    }

    .ml-hero-web {
        width: 300px;
        right: -60px;
        opacity: .35;
    }

    .ml-hero h1.ml-hero-title {
        font-size: 36px;
    }

    .page-container::after,
    body:not(.front) #content.frontend-main::after {
        display: none;
    }

    body.Contact-mail #contact-form {
        padding: 26px 28px 24px;
        margin-bottom: 24px;
    }

    body.Contact-mail #contact-form .form-group {
        gap: 16px;
    }

    body.Contact-mail #contact-form .control-label {
        flex-basis: 116px;
        width: 116px;
    }

    .blog-page-wrapper .blog,
    .post-page-wrapper .post-page {
        padding: 22px 24px;
    }

    article.blog-list,
    article.post-list {
        padding: 4px 0 32px;
        margin-bottom: 32px;
    }
}

@media (max-width: 767px) {
    body {
        padding-top: 66px;
    }

    .navbar-brand {
        padding: 17px 15px;
        height: 66px;
    }

    .navbar-inverse .navbar-nav > li > a {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    #content.frontend-main {
        padding: 24px 0 40px;
    }

    body.Contact-mail .help {
        margin-bottom: 16px;
        padding: 20px 18px 20px 54px;
    }

    body.Contact-mail .help::before {
        top: 22px;
        left: 18px;
        width: 22px;
        height: 22px;
    }

    body.Contact-mail .help::after {
        right: -35px;
        bottom: -35px;
        width: 120px;
        height: 120px;
    }

    body.Contact-mail #contact-form {
        padding: 22px 18px 20px;
    }

    body.Contact-mail #contact-form .form-group {
        display: block;
        margin-bottom: 18px;
    }

    body.Contact-mail #contact-form .control-label {
        display: block;
        width: auto;
        padding: 0;
        margin: 0 0 8px;
    }

    body.Contact-mail #contact-form .form-group > .col-sm-9 {
        width: 100%;
    }

    body.Contact-mail #contact-form .form-group:has(.captcha) {
        padding: 16px;
        margin-bottom: 20px;
    }

    body.Contact-mail #contact-form .captcha-field {
        flex-direction: column;
        align-items: stretch;
    }

    body.Contact-mail #contact-form .captcha-field .form-control {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    body.Contact-mail #contact-form > .form-group {
        margin-top: 22px;
        padding-top: 18px;
    }

    body.Contact-mail #contact-form .btn-success {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .ml-hero {
        padding: 56px 0 72px;
    }

    .ml-hero h1.ml-hero-title {
        font-size: 30px;
    }

    .ml-hero .btn {
        display: block;
        margin: 0 0 12px;
        width: 100%;
    }

    .ml-hero .btn-ml-primary {
        margin-right: 0;
    }

    .blog-page-wrapper .blog,
    .post-page-wrapper .post-page,
    .blog-comment-form-wrapper,
    .post-comment-form-wrapper {
        padding: 18px 18px;
    }

    article.blog-list,
    article.post-list {
        padding: 0 0 28px;
        margin-bottom: 28px;
    }

    article.blog-list.sticky,
    article.post-list.sticky {
        padding-left: 20px;
    }

    .blog .meta .author,
    .blog .meta .date-created {
        display: block;
        margin-bottom: 4px;
    }

    .footer-block {
        margin-bottom: 24px;
    }

    .footer-terms .pull-left,
    .footer-terms .pull-right {
        float: none !important;
        text-align: center;
    }
}
