.long-select {
  min-width: 0;
  max-width: 100%;
}
.long-select [hidden] { display: none !important; }
.long-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: max-content;
  min-width: min(164px, 100%);
  max-width: min(290px, 100%);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}
.long-select-trigger:hover, .long-select-trigger[aria-expanded="true"] { border-color: var(--primary); }
.long-select-trigger:disabled { cursor: not-allowed; }
.long-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.long-select-chevron {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin: -3px 3px 0 0;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.long-select-trigger[aria-expanded="true"] .long-select-chevron { transform: rotate(225deg); margin-top: 3px; }
.long-select-panel {
  position: fixed;
  inset: auto;
  box-sizing: border-box;
  max-height: min(365px, var(--long-select-space, 100dvh));
  margin: 0;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(16, 27, 45, .18);
}
.long-select-panel:popover-open { display: flex; flex-direction: column; gap: 5px; }
.long-select-panel .search-shell { width: 100%; min-width: 0; max-width: none; flex: none; }
.long-select-panel .search-shell input { min-height: 34px; }
.long-select-options {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-gutter: stable;
}
.long-select-options::-webkit-scrollbar { width: 6px; }
.long-select-options::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.long-select-options button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  line-height: 1.3;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.long-select-options button:hover { background: var(--panel-soft); }
.long-select-options button:focus-visible { outline-offset: -2px; }
.long-select-options button[aria-selected="true"] { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.long-select-options button small { font-size: 11px; color: var(--muted); }
.long-select-empty { margin: 0; padding: 10px 8px; color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 480px) {
  .long-select-trigger { min-height: 40px; }
  .long-select-options button { min-height: 40px; }
}
