.hf-machine-preview .hf-device-category { display: none; }
.hf-machine-preview .mp-detail:target:not([hidden]) + .hf-device-category,
.hf-machine-preview .mp-filter-ready .mp-detail:not([hidden]) + .hf-device-category { display: block; }
.hf-machine-preview .hf-device-list { width: 100%; margin: 22px 0 8px; color: #172530; }
.hf-machine-preview .hf-device-category { margin-top: 0; }
.hf-device-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 270px)); }
.hf-device-grid li { min-width: 0; }
.hf-device-grid a { display: flex; flex-direction: column; gap: 7px; height: 100%; padding: 13px; background: white; border: 1px solid #dce6ee; border-radius: 10px; color: #172530; text-decoration: none; }
.hf-device-grid a:hover { border-color: #1474ac; }
.hf-device-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.hf-device-card-title { font-size: 16px; font-weight: 700; }
.hf-device-model { color: #172530; font-weight: 700; }
.hf-device-detail { max-width: 1240px; margin: auto; padding: 24px clamp(16px, 4vw, 48px) 64px; color: #172530; }
.hf-device-breadcrumb { margin-bottom: 28px; font-size: 14px; }
.hf-device-detail a { color: #172530; }
.hf-device-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.hf-device-intro:has(.hf-device-media) { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.hf-device-media { display: grid; min-width: 0; }
.hf-device-image {
    margin: 0;
    aspect-ratio: 1;
    border: 1px solid #dbe6ed;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.hf-device-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hf-device-intro h1 { font-size: clamp(28px, 2.7vw, 41px); line-height: 1.16; margin: 2px 0 18px; }
.hf-device-copy { line-height: 1.65; }
.hf-device-youtube {
    display: block;
    width: 100%;
    height: auto;
    min-height: 200px;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 10px;
    background: #101820;
}
.hf-device-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 24px; }
.hf-device-youtube + .hf-device-actions { margin-top: 36px; }
@media (min-width: 801px) {
    .hf-device-intro:has(.hf-device-media):has(.hf-device-youtube) {
        grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
        column-gap: clamp(26px, 3vw, 44px);
    }
}
.hf-device-detail .hf-device-button { padding: 12px 20px; border-radius: 6px; color: white; background: #172530; font-weight: 700; text-decoration: none; }
.hf-device-detail-content,
.hf-device-video { width: min(100%, 790px); margin-inline: auto; }
.hf-device-detail-content, .hf-device-video { margin-top: clamp(26px, 4vw, 40px); }
.hf-device-detail-content {
    display: grid;
    gap: 26px;
    align-items: start;
}
.hf-device-specs {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(16px, 2vw, 22px);
    border: 1px solid #dbe6ed;
    border-radius: 12px;
    background: #fff;
}
.hf-device-specs #hf-device-specs-title { margin: 0; font-size: clamp(19px, 1.7vw, 23px); }
.hf-device-specs .hf-device-button {
    display: block;
    flex: 0 0 auto;
    text-align: center;
}
.hf-device-specs .hf-device-button:hover { background: #0e4c72; }
.hf-device-spec-list dt,
.hf-device-spec-list dd { overflow-wrap: anywhere; }
.hf-device-specs h2, .hf-device-story h2, .hf-device-video h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 16px; }
.hf-device-spec-list { margin: 0; border: 1px solid #dbe6ed; border-radius: 8px; overflow: hidden; }
.hf-device-spec-list div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; padding: 12px 16px; }
.hf-device-spec-list div:nth-child(odd) { background: #f2f7fa; }
.hf-device-spec-list dt { font-weight: 700; }
.hf-device-spec-list dd { margin: 0; }
.hf-device-video video { display: block; max-width: 100%; width: 720px; }
@media (max-width: 800px) {
    .hf-device-intro:has(.hf-device-media) { grid-template-columns: minmax(0, 1fr); }
    .hf-device-media { width: min(100%, 520px); margin-inline: auto; }
    .hf-device-spec-list div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
}

.single-hopefly_machine { --hf-device-anchor-offset: 88px; }
.single-hopefly_machine.admin-bar {
    --hf-device-anchor-offset: calc(88px + var(--wp-admin--admin-bar--height, 32px));
}
.hf-device-detail :is(section, aside)[id],
.single-hopefly_machine .hf-global-footer #contact { scroll-margin-top: var(--hf-device-anchor-offset); }

@media (min-width: 960px) {
    .hf-device-detail-content.has-sidebar {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) clamp(280px, 28vw, 340px);
        grid-template-areas: "story specs";
    }
    .has-sidebar .hf-device-story { grid-area: story; min-width: 0; }
    .has-sidebar .hf-device-specs {
        grid-area: specs;
        position: sticky;
        top: var(--hf-device-anchor-offset);
        max-height: calc(100dvh - var(--hf-device-anchor-offset) - 18px);
        box-shadow: 0 5px 20px rgba(23, 57, 81, .08);
    }
    .has-sidebar .hf-device-spec-list {
        min-height: 0;
        overflow: auto;
    }
    .has-sidebar .hf-device-spec-list div {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr);
        gap: 8px;
        padding: 9px 10px;
        font-size: 13px;
        line-height: 1.45;
    }
}

.hf-device-story .gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(10px, 1.5vw, 18px);
    margin: 0;
}
.hf-device-story .gallery .gallery-item {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
}
.hf-device-story .gallery .gallery-icon { margin: 0; }
.hf-device-story .gallery a { display: block; border-radius: 10px; }
.hf-device-story .gallery a:focus-visible { outline: 2px solid #172530; outline-offset: 3px; }
.hf-device-story .gallery img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #dbe6ed;
    border-radius: 10px;
}

.hf-device-list { scroll-margin-top: 115px; }
.hf-device-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    margin-top: 24px;
    color: #405b70;
    font-size: 14px;
}
.hf-device-pagination button {
    min-height: 44px;
    padding: 8px 15px;
    border: 1px solid #d4e2ed;
    border-radius: 8px;
    background: #fff;
    color: #172530;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.hf-device-pagination button:hover:not(:disabled) { border-color: #1474ac; background: #f2f7fb; }
.hf-device-pagination button:focus-visible { outline: 2px solid #1474ac; outline-offset: 2px; }
.hf-device-pagination button:disabled { color: #6a7f8f; background: #f5f8fb; cursor: default; }
.hf-device-pagination span { font-variant-numeric: tabular-nums; }
