.mml-homepage,
.mml-homepage * { box-sizing: border-box; }

.mml-homepage {
    --mml-home-accent: #0aa8b5;
    --mml-home-navy: #082c4c;
    --mml-home-hero-overlay-opacity: 1;
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    color: var(--mml-home-navy);
    line-height: 1.35;
}

.mml-homepage a { text-decoration: none; }

.mml-home-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mml-home-container {
    width: min(1280px, calc(100% - 48px));
    margin-inline: auto;
}

.mml-home-hero {
    position: relative;
    min-height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 34px 24px 18px;
    color: #fff;
    background: linear-gradient(135deg, #0a416b, #082c4c);
}

.mml-home-hero::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    pointer-events: none;
    background: linear-gradient(90deg, rgba(4, 36, 65, .84), rgba(5, 51, 88, .69));
    opacity: var(--mml-home-hero-overlay-opacity);
}

.mml-home-hero__background {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mml-home-hero__inner {
    position: relative;
    z-index: 2;
    width: min(1040px, 100%);
    text-align: center;
}

.mml-home-hero h1 {
    margin: 0 0 24px;
    color: #fff;
    font-size: clamp(2rem, 4.1vw, 3.65rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.08;
    text-shadow: 0 2px 14px rgba(3, 27, 49, .32);
}

.mml-home-search {
    width: min(900px, 100%);
    min-height: 78px;
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(210px, .82fr) auto;
    align-items: stretch;
    margin: 0 auto;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 14px 38px rgba(0, 26, 49, .26);
}

.mml-home-search label {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    border-right: 1px solid #d9e3eb;
}

.mml-home-search svg,
.mml-home-emergency svg {
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mml-home-search label svg { width: 28px; height: 28px; color: #607188; }

.mml-home-search input {
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--mml-home-navy);
    font: inherit;
    font-size: 1.05rem;
}

.mml-home-search input::placeholder { color: #66758a; opacity: 1; }

.mml-home-search button {
    min-width: 190px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    border: 0;
    border-radius: 11px;
    background: var(--mml-home-accent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mml-home-accent) 88%, white), var(--mml-home-accent));
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 1.08rem;
    font-weight: 750;
    box-shadow: 0 8px 18px rgba(10, 168, 181, .25);
}

.mml-home-search button svg { width: 26px; height: 26px; }

.mml-home-emergency {
    min-width: 248px;
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 26px;
    padding: 13px 28px;
    border-radius: 11px;
    background: linear-gradient(135deg, #ff5e4d, #ff433c);
    color: #fff !important;
    font-size: 1.28rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(211, 49, 41, .28);
}

.mml-home-emergency svg { width: 42px; height: 42px; }

.mml-home-directory {
    min-height: 390px;
    padding: 22px 0 34px;
    background: radial-gradient(circle at 50% 10%, rgba(10, 168, 181, .05), transparent 36%), #f4f8fb;
}

.mml-home-grid {
    display: grid;
    gap: 16px 28px;
}

.mml-home-cols-1 .mml-home-grid { grid-template-columns: 1fr; }
.mml-home-cols-2 .mml-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mml-home-cols-3 .mml-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mml-home-cols-4 .mml-home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mml-home-cols-5 .mml-home-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mml-home-cols-6 .mml-home-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.mml-home-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 15px;
    border: 1px solid #e5ebf0;
    border-radius: 10px;
    background: #fff;
    color: var(--mml-home-navy) !important;
    box-shadow: 0 8px 24px rgba(8, 44, 76, .10), 0 2px 6px rgba(8, 44, 76, .08);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mml-home-card:hover,
.mml-home-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(10, 168, 181, .45);
    box-shadow: 0 14px 30px rgba(8, 44, 76, .15);
}

.mml-home-card svg {
    width: 58px;
    height: 58px;
    fill: none;
    stroke: var(--mml-home-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mml-home-card span {
    font-size: 1.08rem;
    font-weight: 800;
    text-align: center;
}

.mml-home-popular {
    margin-top: 22px;
}

.mml-home-popular h2 {
    margin: 0 0 14px;
    color: var(--mml-home-navy);
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
    font-weight: 800;
    text-align: center;
}

.mml-home-popular__grid {
    display: grid;
    gap: 14px 22px;
}

.mml-home-popular-cols-1 { grid-template-columns: 1fr; }
.mml-home-popular-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mml-home-popular-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mml-home-popular-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mml-home-popular-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mml-home-popular-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.mml-home-popular__card {
    min-width: 0;
    min-height: 68px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border: 1px solid #e2e9ef;
    border-radius: 10px;
    background: #fff;
    color: var(--mml-home-navy) !important;
    box-shadow: 0 6px 18px rgba(8, 44, 76, .09);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mml-home-popular__card:hover,
.mml-home-popular__card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(10, 168, 181, .45);
    box-shadow: 0 10px 24px rgba(8, 44, 76, .14);
}

.mml-home-popular__card svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: var(--mml-home-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mml-home-popular__card span {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mml-home-popular__card b {
    color: var(--mml-home-accent);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    text-align: right;
}

@media (max-width: 980px) {
    .mml-home-container { width: min(100% - 32px, 860px); }
    .mml-home-search { grid-template-columns: 1fr 1fr; }
    .mml-home-search label:nth-of-type(2) { border-right: 0; }
    .mml-home-search button { grid-column: 1 / -1; min-height: 54px; margin-top: 4px; }
    .mml-home-cols-4 .mml-home-grid,
    .mml-home-cols-5 .mml-home-grid,
    .mml-home-cols-6 .mml-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mml-home-popular-cols-4,
    .mml-home-popular-cols-5,
    .mml-home-popular-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .mml-home-container { width: min(100% - 24px, 560px); }
    .mml-home-hero { min-height: 0; padding: 34px 12px 22px; }
    .mml-home-search { grid-template-columns: 1fr; min-height: 0; padding: 7px; border-radius: 15px; }
    .mml-home-search label { min-height: 58px; padding: 0 15px; border-right: 0; border-bottom: 1px solid #d9e3eb; }
    .mml-home-search label:nth-of-type(2) { border-bottom: 0; }
    .mml-home-search button { grid-column: auto; min-width: 0; min-height: 52px; margin-top: 7px; }
    .mml-home-emergency { min-width: 0; min-height: 56px; margin-top: 18px; padding: 10px 22px; font-size: 1.08rem; }
    .mml-home-emergency svg { width: 34px; height: 34px; }
    .mml-home-directory { padding-top: 14px; }
    .mml-home-cols-2 .mml-home-grid,
    .mml-home-cols-3 .mml-home-grid,
    .mml-home-cols-4 .mml-home-grid,
    .mml-home-cols-5 .mml-home-grid,
    .mml-home-cols-6 .mml-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .mml-home-card { min-height: 104px; padding: 12px 8px; }
    .mml-home-card svg { width: 46px; height: 46px; }
    .mml-home-card span { font-size: .94rem; }
    .mml-home-popular { margin-top: 18px; }
    .mml-home-popular__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mml-home-popular__card { min-height: 60px; grid-template-columns: 38px minmax(0, 1fr) 16px; gap: 7px; padding: 8px 10px; }
    .mml-home-popular__card svg { width: 34px; height: 34px; }
    .mml-home-popular__card span { font-size: .9rem; }
}

@media (max-width: 380px) {
    .mml-home-grid { grid-template-columns: 1fr !important; }
    .mml-home-popular__grid { grid-template-columns: 1fr; }
}
