

/* Mobile */
@media (max-width: 640px) {
    .th-fields { grid-template-columns: 1fr; }
    .th-step .th-step-label { font-size: .8rem; }
}

/* Container ist .th-label position:relative (per JS gesetzt) */
.ac-wrap { position: relative; }

.ac-list {
    position: absolute;
    left: 0; right: 0; top: calc(100% + 6px);
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    padding: .25rem 0;
    z-index: 50;
}

.ac-item {
    list-style: none;
    margin: 0;
    padding: .5rem .75rem;
    cursor: pointer;
    display: block;
}

.ac-item:hover,
.ac-item.is-active {
    background: #f3f4f6;
}

.ac-line {
    display: flex;
    flex-direction: column;
    gap: .125rem;
}

.ac-primary {
    font-size: .95rem;
    color: #111827;
    font-weight: 600;
}
.ac-secondary {
    font-size: .8rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Darken border on parent focus for coherence */
.th-label:has(.th-input:focus) + .ac-wrap .ac-list { border-color: #2563eb; }

/* Mobile narrow tweak: ensure dropdown overlays nicely */
@media (max-width: 640px){
    .ac-list { max-height: 220px; }
}