.mopedgarage-cards,
.mopedgarage-search-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.mopedgarage-card,
.mopedgarage-search-result {
    display: flex;
    flex-direction: column;
    width: 260px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.mopedgarage-card__image img,
.mopedgarage-search-result__image img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.mopedgarage-card__body,
.mopedgarage-search-result {
    padding: 12px;
}

.mopedgarage-card__body h4,
.mopedgarage-search-result h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.mopedgarage-search-panel .fields1 dl,
.mopedgarage-search-embed-panel .fields1 dl {
    margin-bottom: 10px;
}

.mopedgarage-search-actions,
.mopedgarage-upload-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mopedgarage-block,
fieldset.mopedgarage-block,
#cp-main .panel fieldset,
.ucp .panel fieldset {
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.02);
}

.mopedgarage-title,
#cp-main .panel fieldset legend,
.ucp .panel fieldset legend,
.mopedgarage-search-legend {
    font-size: 1.35em;
    font-weight: 700;
    margin-bottom: 12px;
    color: inherit;
    border-bottom: 2px solid currentColor;
    padding-bottom: 6px;
    display: block;
    width: 100%;
    line-height: 1.3;
}

.panel fieldset {
    padding-top: 12px;
}

.mopedgarage-search-query-row {
    margin: 8px 0 0;
}

.mopedgarage-search-query-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mopedgarage-upload-widget {
    margin: 10px 0 18px 0;
}

.mopedgarage-upload-dropzone {
    position: relative;
    border: 2px dashed currentColor;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    background: rgba(127, 127, 127, 0.06);
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    outline: none;
}

.mopedgarage-upload-dropzone:hover,
.mopedgarage-upload-dropzone:focus {
    background: rgba(127, 127, 127, 0.10);
}

.mopedgarage-upload-widget.is-dragover .mopedgarage-upload-dropzone {
    background: rgba(127, 127, 127, 0.14);
    transform: scale(1.01);
}

.mopedgarage-upload-dropzone-inner {
    text-align: center;
    line-height: 1.45;
    pointer-events: none;
}

.mopedgarage-upload-input-wrap,
.mopedgarage-upload-preview-wrap {
    margin-top: 12px;
}

.mopedgarage-upload-input-wrap input[type="file"] {
    width: 100%;
    max-width: 100%;
}

.mopedgarage-upload-preview-wrap.is-hidden {
    display: none;
}

.mopedgarage-upload-preview,
.mopedgarage-upload-preview img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
}

.mopedgarage-upload-preview img,
img.mopedgarage-upload-preview {
    max-height: 260px;
    border-radius: 8px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    background: rgba(127, 127, 127, 0.04);
    padding: 4px;
}

@media (prefers-color-scheme: dark) {
    .mopedgarage-card,
    .mopedgarage-search-result,
    .mopedgarage-block,
    fieldset.mopedgarage-block,
    #cp-main .panel fieldset,
    .ucp .panel fieldset {
        border-color: rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.035);
    }
}

@media (max-width: 700px) {
    .mopedgarage-card,
    .mopedgarage-search-result {
        width: 100%;
    }

    .mopedgarage-block,
    fieldset.mopedgarage-block,
    #cp-main .panel fieldset,
    .ucp .panel fieldset {
        padding: 12px;
        margin-bottom: 16px;
        border-radius: 8px;
    }
}


.mopedgarage-upload-preview--stored {
    margin-top: 12px;
}

.mopedgarage-search-inline-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.mopedgarage-lightbox[hidden] {
    display: none !important;
}

.mopedgarage-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.mopedgarage-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.mopedgarage-lightbox__dialog {
    position: relative;
    z-index: 2;
    width: min(96vw, 1400px);
    height: min(92vh, 1000px);
    margin: 4vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px 20px;
    box-sizing: border-box;
}

.mopedgarage-lightbox__content {
    max-width: 100%;
    max-height: 100%;
    text-align: center;
}

.mopedgarage-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 110px);
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

.mopedgarage-lightbox__caption {
    margin-top: 12px;
    line-height: 1.4;
    text-align: center;
}

.mopedgarage-lightbox__close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    padding: 8px 10px;
    opacity: 0.9;
}

.mopedgarage-post-profile {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(127, 127, 127, 0.25);
}

.mopedgarage-post-profile__title {
    font-weight: 700;
    margin-bottom: 8px;
}

.mopedgarage-post-bike {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.mopedgarage-post-bike:last-child {
    margin-bottom: 0;
}

.mopedgarage-post-bike__image img {
    width: 72px;
    max-width: 72px;
    height: auto;
    border-radius: 6px;
    display: block;
}

.mopedgarage-post-bike__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mopedgarage-post-bike__body strong,
.mopedgarage-post-bike__body span {
    font-size: 0.92em;
    line-height: 1.35;
}

@media (max-width: 700px) {
    .mopedgarage-lightbox__dialog {
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 52px 12px 16px;
    }

    .mopedgarage-lightbox__image {
        max-height: calc(100vh - 110px);
        border-radius: 8px;
    }

    .mopedgarage-lightbox__close {
        top: 8px;
        right: 10px;
        font-size: 34px;
    }
}
