/* Currency Converter. Each row is a calculator row (.tool-number-nounit and .tool-field from tool.css), with
   a drag handle and the currency's flag in its label */

#cc_rows > .cc-row:last-child {
    margin-bottom: 0;
}

#cc_error:not(.d-none) {
    margin-top: 1rem;
}

.cc-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}

.cc-code {
    font-weight: 500;
}

.cc-flag {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.cc-handle {
    flex-shrink: 0;
    margin-left: -0.25rem;
    color: var(--ck-text-3);
    cursor: grab;
    touch-action: none;     /* a touch on the handle drags rather than scrolls */
    user-select: none;
}

.cc-handle:hover {
    color: var(--ck-text-1);
}

/* The row being dragged, and the gap it leaves */
.cc-row.sortable-chosen {
    cursor: grabbing;
}

.cc-row.sortable-ghost {
    opacity: 0.4;
}

/* A converted amount is shown, the one you type is bold, as in the calculators */
#cc_rows .input.cc-source {
    font-weight: 700;
}

/* No number steppers, as in the calculators */
#cc_rows input[type="number"]::-webkit-outer-spin-button,
#cc_rows input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#cc_rows input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* The Edit Currencies dialog: the list keeps one height while it filters, so the dialog doesn't jump as you
   type; a short window still shrinks it, since the dialog scrolls its body */
.cc-list-box {
    height: 24rem;
    scrollbar-width: thin;
}

.cc-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    user-select: none;
}

.cc-option:hover {
    background-color: var(--ck-surface-2);
}

.cc-option .form-check-input {
    flex-shrink: 0;
    margin: 0;
}

.cc-option .cc-flag {
    width: 24px;
    height: 24px;
}
