.trade-mode-switcher {
    display: flex;
    /* The group is as wide as its buttons. Every original user sits in a toolbar row that already
       shrink-wrapped it; a standalone one (the curve-spec editor) is a block-level flex box and
       stretched its border the full width of the page without this. */
    width: fit-content;
    gap: 1px;
    background: rgba(var(--cpd-contrast-rgb), 0.03);
    border: 1px solid rgba(var(--cpd-contrast-rgb), 0.08);
    border-radius: var(--cpd-radius-md);
    padding: 2px;
}

.trade-mode-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--cpd-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    font-size: 14px;
    color: var(--cpd-text-subtle);
    cursor: pointer;
    transition: background var(--cpd-transition-fast), color var(--cpd-transition-fast);
}

.trade-mode-btn:hover {
    color: rgba(var(--cpd-contrast-rgb), calc(0.6 * var(--cpd-text-alpha-scale)));
}

.trade-mode-btn.active {
    background: rgba(var(--cpd-contrast-rgb), 0.06);
    color: var(--cpd-text);
    border-color: rgba(var(--cpd-contrast-rgb), 0.10);
    font-weight: 500;
}

.trade-mode-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.trade-mode-btn:disabled:hover {
    color: var(--cpd-text-subtle);
}

/* Word labels instead of an icon. The base .trade-mode-btn is a fixed 28x28 square because every
   original user of this group is a cluster of icon buttons; put "Full"/"Detail"/"Compact" in one
   and the text overflows the square and the three overlap each other (curve-spec editor, !546).
   A modifier rather than a second component: same group, same states, only the box is different. */
.trade-mode-btn--text {
    width: auto;
    min-width: 28px;
    padding: 0 10px;
    font-size: 12px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
