:root {
    --mlm-blue: #0d6efd;
    --mlm-blue-dark: #0b5ed7;
    --mlm-cyan: #0aa2c0;
    --mlm-green: #20c997;
    --mlm-ink: #172b4d;
    --mlm-muted: #64748b;
    --mlm-border: #dbe4ee;
    --mlm-surface: #ffffff;
    --mlm-soft: #f4f8fb;
    --mlm-radius: 8px;
    --mlm-shadow: 0 16px 42px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, .10), transparent 32rem),
        radial-gradient(circle at top right, rgba(32, 201, 151, .10), transparent 28rem),
        var(--mlm-soft);
    color: var(--mlm-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    margin: 0;
}

img {
    height: auto;
    max-width: 100%;
}

a {
    color: var(--mlm-blue);
    transition: color .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

a:hover,
a:focus {
    color: var(--mlm-blue-dark);
    text-decoration: none;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(13, 110, 253, .18);
    outline-offset: 2px;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(219, 228, 238, .9);
    box-shadow: 0 8px 26px rgba(15, 23, 42, .05);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    align-items: center;
    display: flex;
    gap: 1.25rem;
    justify-content: space-between;
    min-height: 76px;
    padding-bottom: .8rem;
    padding-top: .8rem;
}

.site-header__inner::before,
.site-header__inner::after,
.site-footer__inner::before,
.site-footer__inner::after {
    content: none;
    display: none;
}

.site-logo {
    display: inline-flex;
    flex: 0 0 auto;
}

.site-logo img {
    display: block;
    width: 265px;
}

.site-nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
    margin-left: auto;
}

.site-nav__link,
.site-nav__cta {
    align-items: center;
    border-radius: var(--mlm-radius);
    display: inline-flex;
    font-weight: 650;
    gap: .45rem;
    min-height: 40px;
    padding: .55rem .85rem;
    text-decoration: none;
}

.site-nav__link {
    color: #334155;
}

.site-nav__link:hover,
.site-nav__link:focus,
.site-nav__link.is-active {
    background: rgba(13, 110, 253, .08);
    color: var(--mlm-blue-dark);
}

.site-nav__cta,
.btn-primary,
.btn-success {
    background: linear-gradient(135deg, var(--mlm-blue), var(--mlm-cyan));
    border: 0;
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 110, 253, .22);
}

.site-nav__cta {
    margin-left: 16px;
}

.site-nav__cta:hover,
.site-nav__cta:focus,
.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, var(--mlm-blue-dark), #087f9b);
    color: #fff;
    transform: translateY(-1px);
}

.site-language {
    align-items: center;
    background: rgba(13, 110, 253, .08);
    border: 1px solid rgba(13, 110, 253, .18);
    border-radius: var(--mlm-radius);
    color: var(--mlm-blue-dark);
    display: inline-flex;
    gap: .35rem;
    min-height: 40px;
    padding: .35rem .55rem;
}

.site-language select {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-weight: 750;
    min-width: 2.6rem;
}

.site-main {
    flex: 1 0 auto;
    padding: 2rem 0 2.5rem;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--mlm-border);
    color: var(--mlm-muted);
    padding: 1.15rem 0;
}

.site-footer__inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
}

.content-card,
.link-card,
.category-card,
.ad-card,
.top-sites-card {
    background: var(--mlm-surface);
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius);
    box-shadow: var(--mlm-shadow);
}

.content-card {
    margin-bottom: 1.25rem;
    padding: 1.35rem;
}

.section-heading {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.section-heading h1,
.section-heading h2 {
    color: var(--mlm-ink);
    font-size: 24px;
    font-weight: 750;
    line-height: 1.25;
    margin: 0;
}

.section-heading p {
    color: var(--mlm-muted);
    font-size: 18px;
    margin: .35rem 0 0;
}

.eyebrow {
    color: var(--mlm-cyan);
    display: block;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .08em;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

.category-grid {
    display: grid;
    gap: .85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.category-card {
    align-items: flex-start;
    display: flex;
    gap: .85rem;
    padding: 1rem;
}

.category-card--without-children {
    align-items: center;
}

.category-card:hover {
    border-color: rgba(13, 110, 253, .34);
    box-shadow: 0 14px 34px rgba(13, 110, 253, .10);
}

.category-card__icon {
    align-items: center;
    background: linear-gradient(135deg, rgba(13, 110, 253, .12), rgba(32, 201, 151, .14));
    border-radius: var(--mlm-radius);
    display: inline-flex;
    flex: 0 0 54px;
    height: 54px;
    justify-content: center;
    overflow: hidden;
    width: 54px;
}

.category-card__icon img {
    height: 44px;
    object-fit: contain;
    width: 44px;
}

.category-card__body {
    min-width: 0;
}

.category-card__title {
    color: var(--mlm-ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.category-card__children {
    color: var(--mlm-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-top: .35rem;
}

.category-card__children a {
    color: var(--mlm-muted);
    display: inline-block;
    margin: .1rem .3rem .1rem 0;
}

.category-card__children a:hover,
.category-card__children a:focus {
    color: var(--mlm-blue);
}

.breadcrumb-panel {
    align-items: center;
    color: var(--mlm-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 400;
    gap: .25rem;
    margin-bottom: 1rem;
}

.breadcrumb-panel a {
    font-weight: 400;
}

.breadcrumb-panel__separator {
    align-items: center;
    color: var(--mlm-cyan);
    display: inline-flex;
    font-size: 12px;
    line-height: 1;
    margin: 0 .1rem;
}

.content-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) 280px;
}

.content-main {
    min-width: 0;
}

.content-sidebar {
    min-width: 0;
}

.link-list {
    display: grid;
    gap: .9rem;
}

.link-card {
    display: grid;
    gap: 1rem;
    grid-template-columns: 112px minmax(0, 1fr);
    padding: 1rem;
}

.link-card:hover {
    border-color: rgba(13, 110, 253, .30);
}

.link-card__media {
    align-items: center;
    background: linear-gradient(135deg, rgba(13, 110, 253, .08), rgba(32, 201, 151, .10));
    border: 1px solid rgba(219, 228, 238, .9);
    border-radius: var(--mlm-radius);
    display: flex;
    height: 92px;
    justify-content: center;
    overflow: hidden;
}

.link-card__media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.link-card__body {
    min-width: 0;
}

.link-card__title {
    font-size: 16px;
    font-weight: 750;
    line-height: 1.25;
    margin: 0 0 .4rem;
}

.link-card__title a {
    color: var(--mlm-ink);
}

.link-card__title a:hover,
.link-card__title a:focus {
    color: var(--mlm-blue);
}

.link-card__description {
    color: #475569;
    font-size: 14px;
    margin-bottom: .75rem;
}

.link-card__footer {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    justify-content: space-between;
}

.link-card__date {
    color: var(--mlm-muted);
    font-size: 13px;
}

.link-card__more {
    align-items: center;
    border: 1px solid rgba(13, 110, 253, .22);
    border-radius: var(--mlm-radius);
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: .35rem;
    padding: .35rem .65rem;
}

.ad-card {
    color: var(--mlm-muted);
    margin-bottom: 1rem;
    min-height: 150px;
    overflow: hidden;
    padding: 1rem;
    text-align: center;
}

.ad-card ins {
    max-width: 100%;
}

.top-sites-card {
    min-height: 460px;
    padding: 1.15rem;
}

.top-sites-card__header {
    border-bottom: 1px solid var(--mlm-border);
    margin-bottom: .9rem;
    padding-bottom: .85rem;
}

.top-sites-card__header h2 {
    color: var(--mlm-ink);
    font-size: 20px;
    font-weight: 750;
    line-height: 1.2;
    margin: .15rem 0 0;
}

.top-sites-list {
    counter-reset: top-sites;
    display: grid;
    gap: .7rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-sites-list__item {
    align-items: flex-start;
    border: 1px solid rgba(219, 228, 238, .85);
    border-radius: calc(var(--mlm-radius) - 2px);
    display: grid;
    gap: .45rem;
    padding: .75rem .85rem .75rem 2.75rem;
    position: relative;
}

.top-sites-list__item::before {
    align-items: center;
    background: linear-gradient(135deg, var(--mlm-blue), var(--mlm-cyan));
    border-radius: .75rem;
    color: #fff;
    content: counter(top-sites);
    counter-increment: top-sites;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    height: 1.65rem;
    justify-content: center;
    left: .75rem;
    position: absolute;
    top: .75rem;
    width: 1.65rem;
}

.top-sites-list__link {
    color: var(--mlm-ink);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.25;
}

.top-sites-list__link:hover,
.top-sites-list__link:focus {
    color: var(--mlm-blue);
}

.top-sites-list__views {
    align-items: center;
    color: var(--mlm-muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: .3rem;
}

.top-sites-card__empty {
    color: var(--mlm-muted);
    margin: 0;
}

.form-card {
    margin-left: auto;
    margin-right: auto;
    max-width: none;
}

.frontend-form {
    display: grid;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0;
}

.form-label {
    color: var(--mlm-ink);
    display: block;
    font-weight: 700;
    margin-bottom: .35rem;
}

.form-control {
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius);
    box-shadow: none;
    color: var(--mlm-ink);
    min-height: 42px;
}

.form-control:focus {
    border-color: rgba(13, 110, 253, .55);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, .12);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.form-help {
    color: var(--mlm-muted);
    margin-bottom: 1rem;
}

.form-error {
    color: #dc3545;
    display: block;
    font-size: .88rem;
    font-weight: 600;
    margin-top: .35rem;
}

.checkbox-line {
    align-items: flex-start;
    display: flex;
    gap: .55rem;
}

.checkbox-line input {
    margin-top: .35rem;
}

.captcha-block {
    display: grid;
    gap: .7rem;
}

.btn {
    border-radius: var(--mlm-radius);
    font-weight: 700;
    min-height: 40px;
}

.btn-lg {
    min-height: 46px;
    padding-left: 1.15rem;
    padding-right: 1.15rem;
}

.article-card {
    max-width: none;
}

.rich-text {
    color: #334155;
}

.rich-text h1,
.rich-text h2,
.rich-text h3 {
    color: var(--mlm-ink);
    font-weight: 750;
}

.rich-text ol,
.rich-text ul {
    padding-left: 1.35rem;
}

.rich-text li + li {
    margin-top: .45rem;
}

.details-list {
    display: grid;
    gap: .65rem;
    margin: 1rem 0 0;
}

.details-list__item {
    background: #f8fafc;
    border: 1px solid var(--mlm-border);
    border-radius: var(--mlm-radius);
    display: grid;
    gap: .35rem;
    grid-template-columns: 170px minmax(0, 1fr);
    padding: .7rem .85rem;
}

.details-list__label {
    color: var(--mlm-muted);
    font-weight: 700;
}

.pagination {
    margin: .5rem 0 1.25rem;
}

.pagination > li > a,
.pagination > li > span {
    border-color: var(--mlm-border);
    color: var(--mlm-blue);
    font-weight: 650;
}

.pagination > .active > span,
.pagination > .active > a,
.pagination > .active > span:hover,
.pagination > .active > a:hover {
    background: var(--mlm-blue);
    border-color: var(--mlm-blue);
}

.alert {
    border-radius: var(--mlm-radius);
}

.alert .close {
    border: 0;
    background: transparent;
}

@media (max-width: 991px) {
    .site-header__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
        margin-left: 0;
        width: 100%;
    }

    .site-nav__cta {
        margin-left: 0;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-sidebar {
        display: grid;
        gap: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .top-sites-card {
        min-height: auto;
    }
}

@media (max-width: 767px) {
    body {
        font-size: 14px;
    }

    .site-header {
        position: static;
    }

    .site-header__inner {
        gap: .75rem;
        min-height: auto;
    }

    .site-main {
        padding-top: 1rem;
    }

    .site-logo img {
        width: 224px;
    }

    .site-nav {
        display: grid;
        gap: .45rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-nav__link,
    .site-nav__cta,
    .site-language {
        font-size: .92rem;
        justify-content: center;
        min-height: 38px;
        padding: .4rem .5rem;
        width: 100%;
    }

    .content-card {
        padding: 1rem;
    }

    .section-heading {
        display: block;
    }

    .link-card {
        grid-template-columns: 1fr;
    }

    .link-card__media {
        height: 150px;
    }

    .details-list__item {
        grid-template-columns: 1fr;
    }
}

.category-card__recent {
    margin-top: 12px;
}

.category-card__recent-label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    opacity: .75;
}

.category-card__recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-card__recent-list li {
    margin-bottom: 5px;
}

.category-card__recent-list a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.category-card__all {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.category-card__all:hover {
    text-decoration: underline;
}

.featured-section {
    margin-bottom: 12px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.featured-column {
    min-width: 0;
}

.featured-column__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.featured-column__title span {
    font-size: 18px;
}

.featured-column__title h2 {
    margin: 0;
    color: var(--mlm-ink);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.featured-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.featured-list li {
    margin-bottom: 7px;
}

.featured-list a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.featured-ad-button {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
}

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

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

.featured-links {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.featured-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.featured-column {
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    min-width: 0;
}

.featured-column__title {
    margin-bottom: 10px;
}

.featured-link {
    display: block;
    padding: 7px 8px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s ease;
}

.featured-link:hover {
    background: #fff;
    border-color: #dbe3ec;
    color: #0d6efd;
    transform: none;
}

.featured-column--advertisement {
    display: block;
}

.featured-column--advertisement p {
    margin: 6px 0 12px;
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #dbe3ec;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.cookie-consent__content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.cookie-consent__content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.cookie-consent__content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.cookie-consent__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    border: 1px solid #cfd9e5;
    border-radius: 6px;
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
}

.cookie-btn--secondary:hover {
    background: #f5f7fa;
}

.cookie-btn--primary {
    background: #1683d8;
    border-color: #1683d8;
    color: #fff;
}

.cookie-btn--primary:hover {
    background: #0f6fb9;
    border-color: #0f6fb9;
}

@media (max-width: 700px) {
    .cookie-consent__content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-consent__actions {
        justify-content: flex-end;
    }
}

.cookie-consent__text {
    flex: 1;
}

.cookie-consent__text strong {
    display: block;
    margin-bottom: 5px;
}

.cookie-consent__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-settings {
    max-width: 1200px;
    margin: 16px auto 0;
    padding-top: 16px;
    border-top: 1px solid #e1e7ee;
}

.cookie-settings__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cookie-settings__close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.cookie-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid #edf1f5;
}

.cookie-setting strong {
    display: block;
    margin-bottom: 3px;
}

.cookie-setting p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.cookie-setting__status {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #1683d8;
}

.cookie-settings__save {
    margin-top: 14px;
}

.cookie-switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-switch span {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #cfd7e2;
    transition: 0.2s;
}

.cookie-switch span::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: 0.2s;
}

.cookie-switch input:checked + span {
    background: #1683d8;
}

.cookie-switch input:checked + span::before {
    transform: translateX(20px);
}

@media (max-width: 700px) {
    .cookie-consent__actions {
        flex-wrap: wrap;
    }

    .cookie-setting {
        align-items: flex-start;
    }
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 55px 0 0;
    background: #171c35;
    color: #d7dbea;
}

.site-footer__main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 70px;
    padding-bottom: 45px;
}

.site-footer__brand {
    max-width: 480px;
}

.site-footer__logo {
    display: inline-block;
    margin-bottom: 20px;
}

.site-footer__logo img {
    display: block;
    max-width: 230px;
    height: auto;
}

.site-footer__brand p {
    margin: 0;
    max-width: 460px;
    font-size: 14px;
    line-height: 1.7;
    color: #c7ccda;
}

.site-footer__column h3 {
    margin: 3px 0 20px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
}

.site-footer__column a {
    display: block;
    margin-bottom: 14px;
    color: #c7ccda;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__column a:hover,
.site-footer__column a:focus {
    color: #ffffff;
}

.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: #aeb5c8;
}

.site-footer__bottom span:last-child {
    color: #aeb5c8;
}

@media (max-width: 800px) {
    .site-footer__main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
        max-width: none;
    }
}

@media (max-width: 550px) {
    .site-footer {
        padding-top: 40px;
    }

    .site-footer__main {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .site-footer__brand {
        grid-column: auto;
    }

    .site-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}