/* =========================================================
   HBS GARAGE · Geräte-Wizard · Redesign 2026-08-09
   Isolierter Namespace: hbs-item-*
   ========================================================= */

.hbs-item-wizard {
    width: min(1080px, 100%);
    margin: 0 auto;
}

/* ---------- Kopf ---------- */

.hbs-item-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 0 1.35rem;
}

.hbs-item-header > div:first-child {
    min-width: 0;
}

.hbs-item-header .eyebrow {
    display: inline-block;
    margin-bottom: .4rem;
    color: var(--color-primary);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hbs-item-header h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2.15rem, 4vw, 3.5rem);
    line-height: 1;
    letter-spacing: -.045em;
}

.hbs-item-header p {
    max-width: 650px;
    margin: .65rem 0 0;
    color: var(--color-text-muted);
    font-size: .92rem;
    line-height: 1.55;
}

.hbs-item-header .btn {
    flex: 0 0 auto;
}

/* ---------- Fortschritt ---------- */

.hbs-item-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-small);
}

.hbs-item-step {
    position: relative;
    min-width: 0;
    min-height: 76px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    align-items: center;
    gap: .08rem .65rem;
    padding: .85rem .95rem;
    border: 0;
    border-right: 1px solid var(--color-border);
    border-radius: 0;
    background: #fff;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

.hbs-item-step:last-child {
    border-right: 0;
}

.hbs-item-step::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: transparent;
}

.hbs-item-step > span:first-child {
    grid-row: 1 / 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef2ec;
    color: var(--color-text-muted);
    font-size: .74rem;
    font-weight: 900;
}

.hbs-item-step strong {
    min-width: 0;
    font-size: .82rem;
    line-height: 1.15;
}

.hbs-item-step small {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: .63rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbs-item-step.is-active {
    background: #f6f9f4;
}

.hbs-item-step.is-active::after {
    background: var(--color-primary);
}

.hbs-item-step.is-active > span:first-child,
.hbs-item-step.is-complete > span:first-child {
    background: var(--color-primary);
    color: #fff;
}

/* ---------- Hauptkarte ---------- */

.hbs-item-form {
    display: block;
}

.hbs-item-panel {
    min-height: 0 !important;
    height: auto !important;
    margin: 0;
    padding: clamp(1.2rem, 2.5vw, 1.8rem);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-small);
}

.hbs-item-panel[hidden] {
    display: none !important;
}

.hbs-item-panel-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: .8rem;
    align-items: start;
    max-width: 760px;
    margin: 0 0 1.25rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--color-border);
}

.hbs-item-panel-number {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: .72rem;
    font-weight: 900;
}

.hbs-item-panel-heading h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.5vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -.025em;
}

.hbs-item-panel-heading p {
    max-width: 650px;
    margin: .35rem 0 0;
    color: var(--color-text-muted);
    font-size: .76rem;
    line-height: 1.5;
}

/* ---------- Felder ---------- */

.hbs-item-fields {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(340px, 1.28fr);
    gap: .85rem 1rem;
    align-items: start;
}

.hbs-item-field-wide {
    grid-column: 1 / -1;
}

.hbs-item-wizard .field {
    min-width: 0;
    margin: 0;
}

.hbs-item-wizard .field > label {
    display: block;
    margin: 0 0 .35rem;
    color: var(--color-text);
    font-size: .75rem;
    font-weight: 850;
}

.hbs-item-wizard .input {
    width: 100%;
    min-height: 44px;
    padding: .65rem .78rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--color-text);
    font: inherit;
    font-size: .84rem;
}

.hbs-item-wizard .input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(76, 110, 68, .12);
}

.hbs-item-description-input {
    min-height: 112px !important;
    height: 112px;
    resize: vertical;
}

.hbs-item-field-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .3rem;
}

.hbs-item-wizard .field-help,
.hbs-item-character-counter {
    color: var(--color-text-muted);
    font-size: .64rem;
    line-height: 1.4;
}

.hbs-item-character-counter {
    flex: 0 0 auto;
}

/* ---------- Bilder ---------- */

.hbs-item-existing-images {
    margin-bottom: 1rem;
}

.hbs-item-upload-zone {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) minmax(240px, .75fr);
    gap: .85rem;
    align-items: center;
    padding: 1rem;
    border: 1px dashed var(--color-border-strong);
    border-radius: 14px;
    background: #f8faf7;
}

.hbs-item-upload-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--color-primary-light);
    font-size: 1.1rem;
}

.hbs-item-upload-zone strong {
    display: block;
    font-size: .82rem;
}

.hbs-item-upload-zone p {
    margin: .18rem 0 0;
    color: var(--color-text-muted);
    font-size: .68rem;
    line-height: 1.4;
}

.hbs-item-image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: .65rem;
    margin-top: .75rem;
}

.hbs-item-selected-image {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #fff;
}

.hbs-item-selected-image img {
    width: 100%;
    height: 125px;
    display: block;
    object-fit: cover;
}

/* ---------- Verfügbarkeit ---------- */

.hbs-availability-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.hbs-availability-choice {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    padding: .9rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.hbs-availability-choice > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.hbs-availability-choice-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eef2ec;
    color: var(--color-primary-dark);
    font-weight: 900;
}

.hbs-availability-choice-copy strong,
.hbs-availability-choice-copy small {
    display: block;
}

.hbs-availability-choice-copy strong {
    font-size: .84rem;
}

.hbs-availability-choice-copy small {
    margin-top: .22rem;
    color: var(--color-text-muted);
    font-size: .68rem;
    line-height: 1.4;
}

.hbs-availability-choice.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.hbs-availability-choice.is-selected .hbs-availability-choice-icon {
    background: var(--color-primary);
    color: #fff;
}

.hbs-item-native-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.hbs-item-availability-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .65rem;
    margin-top: .8rem;
    padding: .8rem;
    border: 1px solid #dce6d8;
    border-radius: 12px;
    background: #f6f9f4;
}

.hbs-item-availability-note strong {
    display: block;
    font-size: .75rem;
}

.hbs-item-availability-note p {
    margin: .15rem 0 0;
    color: var(--color-text-muted);
    font-size: .67rem;
    line-height: 1.45;
}

/* ---------- Vorschau ---------- */

.hbs-item-preview-layout {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(300px, 1.1fr);
    gap: .9rem;
}

.hbs-item-preview-card {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    background: #fff;
}

.hbs-item-preview-image {
    position: relative;
    height: 205px;
    overflow: hidden;
    background: #f2f4ef;
}

.hbs-item-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hbs-item-preview-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 3.4rem;
}

.hbs-item-preview-content {
    padding: .95rem;
}

.hbs-item-preview-content h3 {
    margin: .55rem 0 .25rem;
    font-size: 1.05rem;
}

.hbs-item-preview-content p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: .74rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.hbs-item-summary {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    background: linear-gradient(135deg, var(--color-primary-light), #fff);
}

.hbs-item-summary h3 {
    margin: .2rem 0 .7rem;
    font-size: 1.15rem;
}

.hbs-item-summary ul {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hbs-item-summary li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .45rem;
    color: var(--color-text-muted);
    font-size: .7rem;
    line-height: 1.45;
}

.hbs-item-summary li span {
    color: var(--color-primary);
    font-weight: 900;
}

/* ---------- Aktionen ---------- */

.hbs-item-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .8rem;
}

.hbs-item-actions-spacer {
    flex: 1;
}

.hbs-item-actions .btn {
    min-width: 145px;
}

.hbs-item-actions [hidden],
.hbs-item-validation-message[hidden] {
    display: none !important;
}

.hbs-item-validation-message {
    margin-top: .7rem;
    padding: .7rem .8rem;
    border: 1px solid #efcaca;
    border-radius: 10px;
    background: #fff3f3;
    color: var(--color-danger);
    font-size: .72rem;
    font-weight: 700;
}

/* ---------- Bestehende Bildverwaltung ---------- */

.hbs-item-wizard .image-management-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: .7rem;
}

.hbs-item-wizard .managed-image-preview img {
    height: 145px;
}

.hbs-item-wizard .managed-image-actions {
    gap: .4rem;
}

.hbs-item-wizard .managed-image-rotate-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
}

.hbs-item-wizard .managed-image-rotate-actions .btn,
.hbs-item-wizard .image-action-button {
    min-height: 34px;
    padding: .42rem .5rem;
    font-size: .68rem;
}

/* ---------- Tablet ---------- */

@media (max-width: 900px) {
    .hbs-item-wizard,
    .hbs-item-header,
    .hbs-item-form,
    .hbs-item-panel,
    .hbs-item-panel-heading,
    .hbs-item-fields,
    .hbs-item-preview-layout {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-header {
        align-items: flex-start;
        flex-direction: column;
        gap: .8rem;
    }

    .hbs-item-header > div:first-child,
    .hbs-item-header h1,
    .hbs-item-header p {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-header h1 {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .hbs-item-steps {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        padding: 0;

        overflow: visible;

        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .hbs-item-step {
        width: 100%;
        min-width: 0;
        min-height: 68px;

        border: 1px solid var(--color-border);
        border-radius: 12px;
    }

    .hbs-item-step:nth-child(n) {
        border-right: 1px solid var(--color-border);
    }

    .hbs-item-step strong,
    .hbs-item-step small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .hbs-item-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-item-field-wide {
        grid-column: auto;
    }

    .hbs-item-wizard .field,
    .hbs-item-wizard .input,
    .hbs-item-description-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-upload-zone {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: 44px minmax(0, 1fr);
    }

    .hbs-item-upload-zone > * {
        min-width: 0;
        max-width: 100%;
    }

    .hbs-item-upload-zone .hbs-item-image-input {
        grid-column: 1 / -1;
    }

    .hbs-item-preview-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-availability-choice-grid,
    .hbs-item-availability-note {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

/* ---------- Smartphone ---------- */

@media (max-width: 650px) {
    .hbs-item-wizard {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .hbs-item-header {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        margin-bottom: .9rem;
    }

    .hbs-item-header > div:first-child {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-header .eyebrow {
        font-size: .68rem;
    }

    .hbs-item-header h1 {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        font-size: clamp(1.9rem, 9vw, 2.55rem);
        line-height: 1.02;
        letter-spacing: -.04em;

        overflow-wrap: anywhere;
    }

    .hbs-item-header p {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        font-size: .8rem;
        line-height: 1.5;

        overflow-wrap: anywhere;
    }

    .hbs-item-header .btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;

        width: 100%;
        max-width: 100%;
        min-width: 0;

        margin-bottom: .85rem;
    }

    .hbs-item-step {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 64px;

        grid-template-columns: 30px minmax(0, 1fr);
        grid-template-rows: 1fr;
        align-content: center;
        align-items: center;
        gap: 0 .55rem;

        padding: .6rem;
    }

    .hbs-item-step > span:first-child {
        grid-row: 1;
        align-self: center;

        width: 30px;
        height: 30px;
    }

    .hbs-item-step strong {
        grid-row: 1;
        align-self: center;

        min-width: 0;
        margin: 0;

        font-size: .77rem;
        line-height: 1.2;

        overflow-wrap: anywhere;
        word-break: normal;
    }

    .hbs-item-step small {
        display: none;
    }

    .hbs-item-form,
    .hbs-item-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-panel {
        padding: .9rem;
        overflow: hidden;

        border-radius: 14px;
    }

    .hbs-item-panel-heading {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: 36px minmax(0, 1fr);
        gap: .65rem;

        margin-bottom: .9rem;
        padding-bottom: .8rem;
    }

    .hbs-item-panel-heading > div {
        min-width: 0;
        max-width: 100%;
    }

    .hbs-item-panel-number {
        width: 36px;
        height: 36px;
    }

    .hbs-item-panel-heading h2,
    .hbs-item-panel-heading p {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        overflow-wrap: anywhere;
        word-break: normal;
    }

    .hbs-item-panel-heading h2 {
        font-size: clamp(1.2rem, 6.2vw, 1.55rem);
        line-height: 1.15;
    }

    .hbs-item-panel-heading p {
        font-size: .72rem;
        line-height: 1.45;
    }

    .hbs-item-fields,
    .hbs-item-wizard .field,
    .hbs-item-wizard .input,
    .hbs-item-description-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-description-input {
        min-height: 100px !important;
        height: 100px;
    }

    .hbs-item-field-meta {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        align-items: flex-start;
        flex-direction: column;
        gap: .1rem;
    }

    .hbs-item-field-meta > * {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hbs-item-upload-zone {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-item-upload-zone > * {
        min-width: 0;
        max-width: 100%;
    }

    .hbs-item-image-input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-availability-choice-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-availability-choice {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: 40px minmax(0, 1fr);
    }

    .hbs-availability-choice-copy {
        min-width: 0;
        max-width: 100%;
    }

    .hbs-availability-choice-copy strong,
    .hbs-availability-choice-copy small {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hbs-item-availability-note {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: auto minmax(0, 1fr);
    }

    .hbs-item-availability-note > div {
        min-width: 0;
    }

    .hbs-item-availability-note p {
        overflow-wrap: anywhere;
    }

    .hbs-item-preview-layout,
    .hbs-item-preview-card,
    .hbs-item-summary {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-preview-content,
    .hbs-item-summary {
        overflow-wrap: anywhere;
    }

    .hbs-item-actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hbs-item-actions-spacer {
        display: none;
    }

    .hbs-item-actions .btn {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-wizard .image-management-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;

        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-item-wizard .managed-image,
    .hbs-item-wizard .managed-image-preview,
    .hbs-item-wizard .managed-image-actions {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hbs-item-wizard .managed-image-preview img {
        height: 185px;
    }
}

/* ---------- Sehr kleine Geräte ---------- */

@media (max-width: 430px) {
    .hbs-item-header h1 {
        font-size: clamp(1.75rem, 9.5vw, 2.25rem);
    }

    .hbs-item-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-item-step {
        min-height: 58px;
    }

    .hbs-item-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .hbs-item-panel-heading {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: .55rem;
    }

    .hbs-item-panel-number {
        width: 32px;
        height: 32px;
    }
}

/* =========================================================
   Mobile Form Validation · iOS
   Verhindert Safari-Autozoom und zeigt Fehler direkt am Feld.
   ========================================================= */

.hbs-item-wizard .input.is-invalid {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(166, 61, 64, .10) !important;
}

.hbs-item-client-error {
    display: block;
    margin-top: .35rem;
    font-size: .72rem;
    line-height: 1.4;
}

@media (max-width: 650px) {
    /*
     * iOS Safari zoomt beim Fokussieren von Formularfeldern,
     * deren Schrift kleiner als 16px ist.
     */
    .hbs-item-wizard input.input,
    .hbs-item-wizard select.input,
    .hbs-item-wizard textarea.input,
    .hbs-item-wizard .hbs-item-image-input {
        font-size: 16px !important;
    }

    .hbs-item-wizard input.input,
    .hbs-item-wizard select.input {
        min-height: 48px;
    }

    .hbs-item-wizard textarea.input {
        line-height: 1.45;
    }

    .hbs-item-client-error {
        font-size: .75rem;
    }
}

/* =========================================================
   Neue Bilder vor dem Speichern verwalten
   ========================================================= */

.hbs-item-selected-image {
    display: flex;
    flex-direction: column;
}

.hbs-item-selected-image-preview {
    position: relative;
    overflow: hidden;
}

.hbs-item-selected-image-preview img {
    width: 100%;
    height: 150px;
    display: block;
    object-fit: cover;
}

.hbs-selected-image-actions {
    display: grid;
    gap: .45rem;
    padding: .6rem;
}

.hbs-selected-rotate-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
}

.hbs-selected-image-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: .5rem .55rem;
    font-size: .7rem;
}

.hbs-selected-cover-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .45rem .6rem;
    border-radius: 9px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: .7rem;
    font-weight: 800;
}

.hbs-cover-button {
    font-weight: 800;
}

.hbs-selected-delete-button {
    margin-top: .1rem;
}

@media (max-width: 650px) {
    .hbs-item-image-preview-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .8rem;
    }

    .hbs-item-selected-image {
        width: 100%;
        min-width: 0;
        border-radius: 14px;
    }

    .hbs-item-selected-image-preview img {
        height: 210px;
    }

    .hbs-selected-image-actions {
        gap: .55rem;
        padding: .7rem;
    }

    .hbs-selected-image-actions .btn,
    .hbs-selected-cover-indicator {
        min-height: 46px;
        font-size: .78rem;
    }

    .hbs-selected-rotate-actions {
        gap: .5rem;
    }
}

@media (max-width: 430px) {
    .hbs-selected-rotate-actions {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* =========================================================
   HBS Garage · Gegenstand einstellen · Unified Form Design
   2026-08-29
   ========================================================= */

/*
 * Der Wizard soll sich wie die anderen Erstellseiten
 * anfühlen: kompakter, ruhiger und stärker fokussiert.
 */
.hbs-item-wizard {
    width: min(820px, 100%);
    margin-inline: auto;
}


/* ---------- Seitenkopf ---------- */

.hbs-item-header {
    align-items: flex-start;
    gap: 1rem;

    margin-bottom: 1.25rem;
}

.hbs-item-header .eyebrow {
    margin-bottom: .3rem;

    color: var(--color-primary);

    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .08em;
}

.hbs-item-header h1 {
    max-width: 620px;

    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.hbs-item-header p {
    max-width: 570px;

    margin-top: .55rem;

    font-size: .82rem;
    line-height: 1.55;
}

.hbs-item-header .btn {
    min-height: 42px;

    padding-inline: .9rem;

    border-radius: 11px;
}


/* ---------- Fortschritt ---------- */

.hbs-item-steps {
    gap: 5px;

    margin-bottom: .8rem;
    padding: 5px;

    overflow: visible;

    border-radius: 15px;

    background: #f5f7f4;

    box-shadow: none;
}

.hbs-item-step {
    min-height: 59px;

    grid-template-columns: 28px minmax(0, 1fr);

    gap: .05rem .5rem;

    padding: .55rem .65rem;

    border: 0 !important;
    border-radius: 11px;

    background: transparent;
}

.hbs-item-step::after {
    display: none;
}

.hbs-item-step > span:first-child {
    width: 28px;
    height: 28px;

    font-size: .67rem;
}

.hbs-item-step strong {
    font-size: .73rem;
}

.hbs-item-step small {
    font-size: .58rem;
}

.hbs-item-step.is-active {
    background: #fff;

    box-shadow:
        0 2px 8px
        rgba(31, 48, 35, .07);
}


/* ---------- Formular-Karte ---------- */

.hbs-item-panel {
    padding: clamp(1.1rem, 3vw, 1.55rem);

    border-radius: 17px;

    box-shadow:
        0 8px 28px
        rgba(31, 48, 35, .055);
}


/* ---------- Überschrift innerhalb der Karte ---------- */

.hbs-item-panel-heading {
    grid-template-columns: 38px minmax(0, 1fr);

    gap: .7rem;

    max-width: 680px;

    margin-bottom: 1.15rem;
    padding-bottom: .9rem;
}

.hbs-item-panel-number {
    width: 38px;
    height: 38px;

    border-radius: 11px;

    font-size: .67rem;
}

.hbs-item-panel-heading h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.hbs-item-panel-heading p {
    margin-top: .28rem;

    font-size: .72rem;
}


/* ---------- Felder ---------- */

/*
 * Eine ruhige einspaltige Formularstruktur passt
 * besser zu Hilfe suchen / Gemeinsam anschaffen.
 */
.hbs-item-fields {
    grid-template-columns: 1fr;

    gap: .9rem;
}

.hbs-item-field-wide {
    grid-column: auto;
}

.hbs-item-wizard .field > label {
    margin-bottom: .38rem;

    font-size: .72rem;
}

.hbs-item-wizard .input {
    min-height: 48px;

    padding:
        .7rem
        .8rem;

    border-radius: 12px;

    font-size: .82rem;
}

.hbs-item-description-input {
    min-height: 120px !important;
    height: 120px;
}


/* ---------- Aktionen ---------- */

.hbs-item-wizard .btn {
    border-radius: 11px;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 700px) {

    .hbs-item-wizard {
        width: 100%;
    }


    /* Kopf */

    .hbs-item-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;

        gap: .7rem;

        margin-bottom: 1rem;
    }

    .hbs-item-header h1 {
        font-size: 1.85rem;
    }

    .hbs-item-header p {
        font-size: .76rem;
    }

    .hbs-item-header .btn {
        min-height: 38px;

        padding:
            .5rem
            .65rem;

        font-size: .68rem;
    }


    /*
     * Mobile zeigen wir die vier Schritte kompakt.
     * Die Erklärtexte unter den Schrittnamen brauchen
     * auf dem kleinen Display keinen Platz.
     */
    .hbs-item-steps {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 3px;

        padding: 4px;
    }

    .hbs-item-step {
        min-height: 55px;

        display: flex;
        flex-direction: column;

        justify-content: center;
        align-items: center;

        gap: 4px;

        padding: .45rem .25rem;

        text-align: center;
    }

    .hbs-item-step > span:first-child {
        width: 25px;
        height: 25px;

        flex: 0 0 25px;
    }

    .hbs-item-step strong {
        width: 100%;

        overflow: hidden;

        font-size: .61rem;

        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hbs-item-step small {
        display: none;
    }


    /* Karte */

    .hbs-item-panel {
        padding:
            1rem
            .9rem;

        border-radius: 15px;
    }

    .hbs-item-panel-heading {
        grid-template-columns:
            34px
            minmax(0, 1fr);

        gap: .6rem;

        margin-bottom: 1rem;
        padding-bottom: .8rem;
    }

    .hbs-item-panel-number {
        width: 34px;
        height: 34px;
    }

    .hbs-item-panel-heading h2 {
        font-size: 1.15rem;
    }

    .hbs-item-panel-heading p {
        font-size: .68rem;
        line-height: 1.45;
    }


    /* Felder */

    .hbs-item-wizard .input {
        min-height: 47px;

        font-size: 16px;
    }

    .hbs-item-description-input {
        min-height: 115px !important;
        height: 115px;
    }

    .hbs-item-field-meta {
        gap: .5rem;
    }
}


/*
 * Sehr kleine Smartphones:
 * Schrittbezeichnungen weiter vereinfachen.
 */
@media (max-width: 390px) {

    .hbs-item-step {
        min-height: 52px;
    }

    .hbs-item-step strong {
        font-size: .57rem;
    }

    .hbs-item-header h1 {
        font-size: 1.7rem;
    }
}

/* =========================================================
   Bildverwaltung · bestehende Bilder
   ========================================================= */

.hbs-item-existing-images {
    margin-bottom: 1rem;
}

.hbs-item-existing-images .image-management-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: .85rem;
    align-items: stretch;
}

.hbs-item-existing-images .managed-image {
    width: 100%;
    min-width: 0;
    height: 100%;

    display: grid;
    grid-template-rows:
        210px
        auto;

    align-self: stretch;
    overflow: hidden;

    border: 1px solid var(--color-border);
    border-radius: 15px;

    background: #fff;

    box-shadow:
        0 3px 14px
        rgba(31, 48, 35, .045);
}


/* ---------- Bild ---------- */

.hbs-item-existing-images .managed-image-preview {
    position: relative;

    width: 100%;
    height: 210px;
    min-height: 210px;
    max-height: 210px;

    overflow: hidden;

    background: var(--color-surface-muted);
}

.hbs-item-existing-images .managed-image-preview img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* ---------- Titelbild-Badge im Foto ---------- */

.hbs-item-existing-images .cover-image-badge {
    position: absolute;

    z-index: 2;
    top: 10px;
    left: 10px;

    display: inline-flex;
    align-items: center;
    gap: .3rem;

    padding: .42rem .62rem;

    border-radius: 999px;

    background: var(--hbs-green-900);
    color: #fff;

    font-size: .68rem;
    font-weight: 850;

    box-shadow:
        0 3px 10px
        rgba(9, 54, 31, .18);
}

.hbs-item-existing-images .cover-image-badge::before {
    content: "★";

    font-size: .66rem;
}


/* ---------- Aktionsbereich ---------- */

.hbs-item-existing-images .managed-image-actions {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    grid-template-rows:
        44px
        44px
        44px;

    grid-template-areas:
        "cover cover"
        "left right"
        "delete delete";

    gap: .5rem;

    align-content: start;

    padding: .65rem;
}


/* ---------- Titelbild-Zeile ---------- */

.hbs-item-existing-images .image-cover-static,
.hbs-item-existing-images .image-cover-button {
    grid-area: cover;

    width: 100%;
    height: 44px;
    min-height: 44px;
    max-height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;

    margin: 0;
    padding: 0 .65rem;

    border:
        1px solid
        rgba(23, 99, 61, .12);

    border-radius: 10px;

    background:
        var(--hbs-green-050) !important;

    color:
        var(--hbs-green-900) !important;

    box-shadow: none !important;

    font-size: .7rem;
    font-weight: 850;
    line-height: 1;

    white-space: nowrap;
}

.hbs-item-existing-images .image-cover-static {
    cursor: default;
}

.hbs-item-existing-images .image-cover-button {
    cursor: pointer;
}

.hbs-item-existing-images .image-cover-button:hover {
    border-color:
        rgba(23, 99, 61, .26);

    background:
        #edf5ea !important;
}


/*
 * Alte Pseudo-Titelbild-Zeile vollständig deaktivieren.
 */
.hbs-item-existing-images
.managed-image:has(.cover-image-badge)
.managed-image-actions::before {
    content: none !important;
    display: none !important;
}


/* ---------- Drehbuttons ---------- */

.hbs-item-existing-images .managed-image-rotate-actions {
    display: contents;
}

.hbs-item-existing-images
.managed-image-rotate-actions
.image-rotate-button:first-child {
    grid-area: left;
}

.hbs-item-existing-images
.managed-image-rotate-actions
.image-rotate-button:last-child {
    grid-area: right;
}

.hbs-item-existing-images .image-rotate-button {
    width: 100%;
    min-width: 0;

    height: 44px;
    min-height: 44px;
    max-height: 44px;

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;

    align-items: center;
    justify-content: center;

    gap: .3rem;

    margin: 0;
    padding: 0 .4rem;

    overflow: hidden;

    border:
        1px solid
        var(--color-border) !important;

    border-radius: 10px;

    background: #fff !important;

    color:
        var(--color-text) !important;

    box-shadow: none !important;

    font-size: .64rem;
    font-weight: 750;
    line-height: 1;

    white-space: nowrap !important;
}

.hbs-item-existing-images .image-rotate-button:hover {
    border-color:
        rgba(23, 99, 61, .24) !important;

    background:
        var(--hbs-green-050) !important;
}

.hbs-item-existing-images
.image-rotate-button
.image-rotate-label {
    display: inline;

    flex: 0 0 auto;

    line-height: 1;

    white-space: nowrap;
}


/*
 * Die Pfeile werden bewusst über CSS erzeugt.
 * Dadurch können Pfeil und Beschriftung nicht
 * getrennt umbrechen.
 */
.hbs-item-existing-images
.image-rotate-button:first-child::before {
    content: "↶";

    display: inline-block;

    flex: 0 0 auto;

    font-size: .9em;
    line-height: 1;
}

.hbs-item-existing-images
.image-rotate-button:last-child::after {
    content: "↷";

    display: inline-block;

    flex: 0 0 auto;

    font-size: .9em;
    line-height: 1;
}

.hbs-item-existing-images .image-rotate-icon {
    display: none !important;
}


/* ---------- Löschen ---------- */

.hbs-item-existing-images .image-action-button.danger {
    grid-area: delete;

    width: 100%;

    height: 44px;
    min-height: 44px;
    max-height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;

    border:
        1px solid
        rgba(185, 56, 56, .18);

    border-radius: 10px;

    background: #c43e3e;
    color: #fff;

    font-size: .7rem;
    font-weight: 800;

    white-space: nowrap;
}

.hbs-item-existing-images .image-action-button.danger:hover {
    background: #a52f2f;
}


/* ---------- Drag Handle ---------- */

.hbs-item-existing-images .image-drag-handle {
    position: absolute;

    z-index: 3;
    top: 10px;
    right: 10px;

    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    padding: 0;

    border:
        1px solid
        rgba(31, 48, 35, .12);

    border-radius: 8px;

    background:
        rgba(255, 255, 255, .94);

    color:
        var(--color-text-muted);

    font-size: .8rem;

    cursor: grab;

    backdrop-filter: blur(5px);
}

.hbs-item-existing-images .image-drag-handle:active {
    cursor: grabbing;
}


/* =========================================================
   Bildverwaltung · Mobile
   ========================================================= */

@media (max-width: 700px) {

    .hbs-item-existing-images .image-management-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: .55rem;
    }

    .hbs-item-existing-images .managed-image {
        grid-template-rows:
            135px
            auto;
    }

    .hbs-item-existing-images .managed-image-preview {
        height: 135px;
        min-height: 135px;
        max-height: 135px;
    }

    .hbs-item-existing-images .managed-image-actions {
        grid-template-rows:
            40px
            40px
            40px;

        gap: .4rem;

        padding: .5rem;
    }

    .hbs-item-existing-images .image-cover-static,
    .hbs-item-existing-images .image-cover-button,
    .hbs-item-existing-images .image-rotate-button,
    .hbs-item-existing-images .image-action-button.danger {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
    }

    .hbs-item-existing-images .image-cover-static,
    .hbs-item-existing-images .image-cover-button {
        padding: 0 .35rem;

        border-radius: 9px;

        font-size: .6rem;
    }

    .hbs-item-existing-images .image-rotate-button {
        padding: 0 .25rem;

        font-size: .61rem;
    }

    .hbs-item-existing-images .image-action-button.danger {
        font-size: .61rem;
    }

    .hbs-item-existing-images .cover-image-badge {
        top: 7px;
        left: 7px;

        padding:
            .3rem
            .45rem;

        font-size: .58rem;
    }
}


/*
 * Sehr schmale Smartphones:
 * Eine Bildkarte pro Reihe.
 */
@media (max-width: 430px) {

    .hbs-item-existing-images .image-management-grid {
        grid-template-columns:
            minmax(0, 1fr);
    }

    .hbs-item-existing-images .managed-image {
        grid-template-rows:
            210px
            auto;
    }

    .hbs-item-existing-images .managed-image-preview {
        height: 210px;
        min-height: 210px;
        max-height: 210px;
    }
}
