/* Custom dropdown (dropdown.js) replacing <select data-dropdown>; the native select stays hidden in the form. */
.dd { position: relative; display: inline-flex; min-width: 0; height: 100%; }
.dd__button { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; height: 100%; padding: 0; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; }
.dd__button:focus-visible { outline: none; } /* ring is drawn by the .topbar__action wrapper (:focus-within) */
.dd__value { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__action .dd__chevron, .topbar__action .dd__check { display: inline-block; font-size: var(--icon-size-md); }
.topbar__action .dd__chevron { color: var(--text-secondary); transition: transform var(--transition-base); }
.dd--open .dd__chevron { transform: rotate(180deg); }
.dd__list { position: absolute; left: 0; top: calc(100% + var(--space-1) + 4px); z-index: 200; min-width: 100%; width: max-content; max-width: min(320px, calc(100vw - var(--space-2))); max-height: 280px; margin: 0; padding: 4px 0; overflow-y: auto; list-style: none; background: var(--bg-card); color: var(--text-primary); border: var(--hairline) solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-md); outline: none; }
.dd__list[hidden] { display: none; }
.dd__option { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: var(--space-5); padding: 0 var(--space-2); font-family: var(--font-body); font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); cursor: pointer; }
.dd__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__option--active { background: var(--color-accent-muted); }
.dd__check { visibility: hidden; }
.dd__option[aria-selected="true"] { font-weight: var(--font-weight-bold); }
.dd__option[aria-selected="true"] .dd__check { visibility: visible; }
.dd__list:focus-visible .dd__option--active { outline: 2px solid var(--color-accent); outline-offset: -2px; border-radius: var(--radius-sm); }
@media (min-width: 769px) { .topbar__company { flex-shrink: 0; } }
@media (max-width: 768px) { .dd { width: 100%; } .dd__button { width: 100%; justify-content: space-between; } .dd__option { min-height: var(--touch-target-min); } .topbar__action .dd__chevron { font-size: 20px; margin-right: -4px; } }
@media (prefers-reduced-motion: reduce) { .dd__chevron { transition: none; } }
