.qto-dims {
    background: var(--cm-panel);
    color: var(--cm-ivory);
    border-radius: var(--cm-radius-panel);
    padding: 16px;
    margin: 12px 0 16px;
}

.qto-dims__head h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--cm-ivory);
}

.qto-dims__note {
    margin: 0 0 8px;
    color: var(--cm-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.qto-dims__status-line {
    min-height: 1.2em;
    margin: 0 0 10px;
    color: var(--cm-accent);
    font-size: 0.88rem;
}

.qto-dims__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* Row gap ≥ the 44px hit-area overflow so neighbouring tap targets never overlap. */
    gap: 16px 12px;
    margin-bottom: 12px;
}

.qto-dims__count {
    font-size: 0.82rem;
}

.qto-dims__group {
    margin: 2px 0 0;
    color: var(--cm-muted);
    font-size: 0.8rem;
}

.qto-dims__picker {
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid rgba(226, 226, 230, 0.16);
    border-radius: 10px;
    background: var(--cm-night);
}

.qto-dims__picker-title {
    margin: 0 0 10px;
    color: var(--cm-ivory);
    font-size: 0.9rem;
}

.qto-dims__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 10px;
}

.qto-dims__filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    color: var(--cm-muted);
    font-size: 0.82rem;
}

.qto-dims__filter select {
    min-width: 160px;
    max-width: 100%;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid rgba(226, 226, 230, 0.28);
    background: var(--cm-panel);
    color: var(--cm-ivory);
}

.qto-dims__actions--compact {
    margin-bottom: 8px;
}

.qto-dims__pick-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 220px;
    overflow: auto;
}

.qto-dims__pick-list--other {
    max-height: 160px;
    margin-top: 8px;
    margin-bottom: 0;
}

.qto-dims__other {
    margin: 0 0 12px;
    color: var(--cm-muted);
    font-size: 0.86rem;
}

.qto-dims__other summary {
    cursor: pointer;
    color: var(--cm-ivory);
    user-select: none;
}

.qto-dims__pick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.qto-dims__pick {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--cm-ivory);
    font-size: 0.88rem;
    line-height: 1.4;
    cursor: pointer;
    min-height: 44px;
    flex: 1 1 220px;
}

.qto-dims__pick input {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
}

.qto-dims__pick-state {
    color: var(--cm-muted);
    font-size: 0.8rem;
}

.qto-dims__pick-state--busy {
    color: var(--cm-accent);
}

.qto-dims__pick-state--ok {
    color: #E2E2E6;
}

.qto-dims__pick-state--fail {
    color: #FFD60A;
}

/* Buttons: flat translucent dark-grey, no border, box hugs the text (font size untouched).
   The ::before pseudo-element keeps the tap target ≥ 44×44 without growing the visual box. */
.qto-dims__btn {
    position: relative;
    border: 0;
    background: rgba(99, 99, 102, 0.32);
    color: var(--cm-ivory);
    border-radius: 7px;
    padding: 5px 10px;
    line-height: 1.3;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.qto-dims__btn::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: max(100%, 44px);
    height: max(100%, 44px);
    transform: translate(-50%, -50%);
}

.qto-dims__btn:hover:not(:disabled) {
    background: rgba(99, 99, 102, 0.46);
}

.qto-dims__btn:focus-visible {
    outline: 2px solid rgba(10, 132, 255, 0.7);
    outline-offset: 2px;
}

.qto-dims__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qto-dims__btn--primary {
    background: rgba(10, 132, 255, 0.24);
    color: #E2E2E6;
}

.qto-dims__btn--primary:hover:not(:disabled) {
    background: rgba(10, 132, 255, 0.36);
}

.qto-dims__btn--inline {
    padding: 3px 8px;
}

.qto-dims__progress {
    height: 6px;
    margin: 0 0 12px;
    border-radius: 3px;
    background: rgba(226, 226, 230, 0.14);
    overflow: hidden;
}

.qto-dims__progress-bar {
    height: 100%;
    background: var(--cm-accent);
    transition: width 0.25s ease;
}

.qto-dims__table-wrap {
    overflow-x: auto;
}

.qto-dims__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.qto-dims__table th,
.qto-dims__table td {
    border-bottom: 1px solid rgba(226, 226, 230, 0.12);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

.qto-dims__table th {
    color: var(--cm-accent);
    font-weight: 600;
    white-space: nowrap;
}

.qto-dims__input {
    width: 5.5rem;
    max-width: 100%;
    border: 1px solid rgba(226, 226, 230, 0.28);
    background: var(--cm-night);
    color: var(--cm-ivory);
    border-radius: 6px;
    padding: 6px 8px;
}

.qto-dims__input--half {
    width: 4.2rem;
}

.qto-dims__size {
    font-variant-numeric: tabular-nums;
}

.qto-dims__status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
}

.qto-dims__status--ok {
    background: rgba(10, 132, 255, 0.14);
    color: #E2E2E6;
}

.qto-dims__status--pending {
    background: rgba(255, 159, 10, 0.16);
    color: #FFD60A;
}

@media (max-width: 720px) {
    .qto-dims {
        padding: 12px;
    }

    .qto-dims__table th,
    .qto-dims__table td {
        padding: 7px 6px;
        font-size: 0.85rem;
    }
}
