.akhome-block,
.akhome-block * {
    box-sizing: border-box;
}

.akhome-block {
    --ak-orange: #ff5a1f;
    --ak-orange2: #ff7a1a;
    --ak-dark: #202632;
    --ak-muted: #667085;
    --ak-border: #e8ebef;
    --ak-bg: #f7f8fa;
    --ak-ui-orange: var(--ak-orange, #ff5a1f);
    --ak-ui-orange-2: var(--ak-orange2, #ff7a1a);
    --ak-ui-dark: var(--ak-dark, #202632);
    --ak-ui-white: #fff;
    --ak-ui-card-radius: 20px;
    --ak-ui-card-radius-mobile: 16px;
    --ak-ui-btn-radius: 14px;
    --ak-ui-btn-radius-small: 12px;
    --ak-ui-focus-ring: 0 0 0 4px rgba(255,90,31,.14);
    --ak-ui-card-shadow: 0 12px 28px rgba(32,38,50,.06);
    --ak-ui-warm-accent: var(--akui-color-accent, #a94824);
    --ak-ui-warm-accent-2: var(--akui-color-accent-2, #eca174);
    --ak-ui-warm-border: var(--akui-color-accent-border, rgba(233,111,68,.28));
    --ak-ui-warm-border-hover: var(--akui-color-accent-border-hover, rgba(233,111,68,.42));
    --ak-ui-hover-shadow: 0 16px 34px rgba(32,38,50,.08), 0 0 20px rgba(255,90,31,.08);
    color: var(--ak-dark);
    width: 100%;
}

.akhome-wrap {
    width: min(var(--ak-container, 1320px), calc(100% - 32px));
    margin: 0 auto;
}

.akhome-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 22px;
}

.akhome-head h2 {
    margin: 0;
    font-size: clamp(24px, 2.1vw, 34px);
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.02em;
}

.akhome-head p {
    margin: 8px 0 0;
    color: var(--ak-muted);
    line-height: 1.45;
}

.akhome-link {
    font-weight: 800;
    color: var(--ak-orange);
    text-decoration: none;
}

.akhb {
    padding: 32px 0;
    background: var(--ak-ui-white, #fff);
}

/* v1.0.7 — columns + automatic size.
   Auto mode uses the selected column count and calculates tile width from module width.
   Fixed mode keeps exact tile px size. */
.akhb-grid {
    --akhb-cols-current: var(--akhb-cols-d, 6);
    --akhb-gap-current: var(--akhb-gap, 12px);
    display: flex !important;
    flex-wrap: wrap;
    gap: var(--akhb-gap-current);
    align-items: stretch;
}

.akhb-grid.akhb-grid--mobile {
    display: none !important;
}

.akhb-align-left .akhb-grid {
    justify-content: flex-start;
}

.akhb-align-center .akhb-grid {
    justify-content: center;
}

.akhb-align-right .akhb-grid {
    justify-content: flex-end;
}

/* Auto size: no overflow, no random growth — tile fills its column */
.akhb-size-auto .akhb-tile {
    flex: 0 1 calc((100% - ((var(--akhb-cols-current) - 1) * var(--akhb-gap-current))) / var(--akhb-cols-current));
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
}

/* Fixed size: old precise px behavior */
.akhb-size-fixed .akhb-tile {
    flex: 0 0 var(--akhb-tile, 100px);
    width: var(--akhb-tile, 100px) !important;
    height: var(--akhb-tile, 100px) !important;
    min-width: var(--akhb-tile, 100px) !important;
    min-height: var(--akhb-tile, 100px) !important;
    max-width: var(--akhb-tile, 100px) !important;
    max-height: var(--akhb-tile, 100px) !important;
}

.akhb-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(233,111,68,.16);
    border-radius: var(--ak-ui-card-radius, 20px);
    background: linear-gradient(180deg, #fff 0%, #fffaf7 100%);
    box-shadow:
        0 10px 24px rgba(32,38,50,.045),
        0 6px 16px rgba(255,90,31,.035);
    padding: 0;
    text-decoration: none;
    color: var(--ak-dark);
    font-weight: 850;
    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;
    overflow: hidden;
}

.akhb-tile:hover,
.akhb-tile:focus-visible {
    border-color: var(--ak-ui-warm-border-hover);
    box-shadow: var(--ak-ui-hover-shadow, 0 16px 34px rgba(32,38,50,.08), 0 0 20px rgba(255,90,31,.08));
    background: linear-gradient(180deg, #fffdfb 0%, #fff6f0 100%);
    transform: translateY(-2px);
    outline: none;
}

.akhb-tile img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
}

.akhb-tile span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    line-height: 1.15;
    background: transparent;
}

@media (max-width: 640px) {
    .akhome-wrap {
        width: min(100% - 24px, 1320px);
    }

    .akhome-head {
        display: block;
    }

    .akhome-link {
        display: inline-flex;
        margin-top: 10px;
    }

    .akhb-grid {
        --akhb-cols-current: var(--akhb-cols-m, 3);
        --akhb-gap-current: var(--akhb-gap-mobile, 10px);
    }

    .akhb-size-fixed .akhb-tile {
        flex-basis: var(--akhb-tile-mobile, 76px);
        width: var(--akhb-tile-mobile, 76px) !important;
        height: var(--akhb-tile-mobile, 76px) !important;
        min-width: var(--akhb-tile-mobile, 76px) !important;
        min-height: var(--akhb-tile-mobile, 76px) !important;
        max-width: var(--akhb-tile-mobile, 76px) !important;
        max-height: var(--akhb-tile-mobile, 76px) !important;
        border-radius: var(--ak-ui-card-radius-mobile, 16px);
    }

    .akhb-size-auto .akhb-tile {
        border-radius: var(--ak-ui-card-radius-mobile, 16px);
    }

    .akhb-tile span {
        padding: 7px;
        font-size: 11px;
    }

    .akhb-mobile-scroll .akhb-grid.akhb-grid--desktop {
        display: none !important;
    }

    .akhb-mobile-scroll .akhb-grid.akhb-grid--mobile {
        display: flex !important;
    }

    .akhb-mobile-scroll.akhome-block.akhb,
    .akhb-mobile-scroll .akhome-wrap,
    .akhb-mobile-scroll .akhb-grid {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .ak-native-slot:has(.akhb-mobile-scroll) > .sp-module,
    .ak-native-slot:has(.akhb-mobile-scroll) > .moduletable,
    .ak-native-slot:has(.akhb-mobile-scroll) .sp-module:first-child,
    .ak-native-slot:has(.akhb-mobile-scroll) .moduletable:first-child {
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .akhb-mobile-scroll.akhome-block.akhb {
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .akhb-mobile-scroll .akhome-wrap {
        padding: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .akhb-mobile-scroll .akhome-head {
        margin-bottom: 14px;
    }

    .akhb-mobile-scroll .akhb-grid {
        --akhb-gap-current: var(--akhb-gap-mobile, 10px);
        position: relative;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: stretch;
        gap: var(--akhb-gap-current);
        width: 100vw;
        max-width: 100vw;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-left: max(16px, env(safe-area-inset-left));
        padding: 2px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        scrollbar-width: none;
        contain: paint;
        transform: translateZ(0);
        backface-visibility: hidden;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    }

    .akhb-mobile-scroll .akhb-grid::-webkit-scrollbar {
        display: none;
    }

    .akhb-mobile-scroll.akhb-size-auto .akhb-tile,
    .akhb-mobile-scroll.akhb-size-fixed .akhb-tile {
        flex: 0 0 var(--akhb-tile-mobile, 76px);
        width: var(--akhb-tile-mobile, 76px) !important;
        min-width: var(--akhb-tile-mobile, 76px) !important;
        max-width: var(--akhb-tile-mobile, 76px) !important;
        height: var(--akhb-tile-mobile, 76px) !important;
        min-height: var(--akhb-tile-mobile, 76px) !important;
        max-height: var(--akhb-tile-mobile, 76px) !important;
        aspect-ratio: 1 / 1;
        scroll-snap-align: start;
        border-radius: var(--ak-ui-btn-radius, 14px);
        transform: translateZ(0);
        backface-visibility: hidden;
    }

    .akhb-mobile-scroll .akhb-grid--mobile .akhb-tile img {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}


/* v1.0.21 — independent brands block after services decoupling */
.akhome-block.akhb {
    padding-top: 24px !important;
}

@media (max-width: 767px) {
    .akhome-block.akhb {
        padding-top: 22px !important;
    }
}
