:root { --phx-select-accent: #7d1407; }
.appeal-page { --phx-select-accent: #66307c; }
.account-page { --phx-select-accent: #176e74; }

button.phx-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #cfcacd;
  border-radius: 0;
  color: #201d21;
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

select.phx-select-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

button.phx-select-trigger .phx-select-value {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.phx-select-trigger::after {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: -4px 2px 0 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

button.phx-select-trigger[aria-expanded="true"] {
  border-color: var(--phx-select-accent);
  box-shadow: inset 0 0 0 1px var(--phx-select-accent);
}

button.phx-select-trigger:disabled { opacity: .55; cursor: not-allowed; }

.phx-select-sheet[hidden] { display: none !important; }
.phx-select-sheet {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: block;
  padding: 0;
  pointer-events: none;
  font-family: "Phoenix Noto Sans SC", Arial, "Microsoft YaHei", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.phx-select-sheet.is-desktop-popover {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
}
.phx-select-sheet.is-desktop-popover .phx-select-backdrop {
  position: fixed;
}
.phx-select-sheet.is-desktop-popover .phx-select-panel {
  position: absolute;
}
.phx-select-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.phx-select-panel {
  position: fixed;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: auto;
  max-height: 520px;
  margin: 0;
  overflow: hidden;
  pointer-events: auto;
  color: #181719;
  background: #fff;
  border: 1px solid #cfcacd;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 14px 34px rgba(27, 22, 29, .18);
  -webkit-tap-highlight-color: transparent;
}
.phx-select-panel:focus { outline: none; }
.phx-select-sheet-head {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 68px;
  padding: 13px 18px 11px 20px;
  border-bottom: 1px solid #e5e2e4;
}
.phx-select-sheet-head span {
  color: #757075;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .14em;
}
.phx-select-sheet-head strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  line-height: 1.3;
}
.phx-select-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #d8d4d7;
  border-radius: 50%;
  color: #2a272b;
  background: #fff;
  font: 400 23px/1 Arial, sans-serif;
}
.phx-select-search-wrap {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid #ece9eb;
  background: #fff;
}
.phx-select-search-wrap::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 25px;
  left: 26px;
  width: 10px;
  height: 10px;
  border: 1.5px solid #777177;
  border-radius: 50%;
  pointer-events: none;
}
.phx-select-search-wrap::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 36px;
  left: 36px;
  width: 6px;
  height: 1.5px;
  background: #777177;
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}
.phx-select-search {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 14px 0 42px;
  border: 1px solid #d9d5d8;
  border-radius: 0;
  outline: 0;
  color: #1e1b1f;
  background: #f8f7f7;
  font: inherit;
  font-size: 15px;
}
.phx-select-search:focus { border-color: var(--phx-select-accent); box-shadow: inset 0 0 0 1px var(--phx-select-accent); }
.phx-select-options {
  display: grid;
  gap: 2px;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.phx-select-option {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: auto;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  color: #272329;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  text-align: left;
}
.phx-select-option-label {
  display: flex;
  flex: 1 1 auto;
  align-self: center;
  justify-content: center;
  flex-direction: column;
  min-width: 0;
}
.phx-select-option-label.is-single-line {
  min-height: 24px;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.phx-select-option-label.is-bilingual {
  display: flex;
  gap: 2px;
  justify-content: center;
  padding: 0;
  overflow: visible;
  white-space: normal;
}
.phx-select-option-label.is-bilingual strong,
.phx-select-option-label.is-bilingual small {
  display: block;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
.phx-select-option-label.is-bilingual strong {
  color: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}
.phx-select-option-label.is-bilingual small {
  color: #706a70;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.phx-select-option:hover { background: #f5f2f6; }
.phx-select-option::after {
  content: "";
  display: flex;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9c4c8;
  border-radius: 50%;
  color: #fff;
  background: #fff;
  font-size: 12px;
  line-height: 1;
  align-self: center;
  margin-top: 0;
}
.phx-select-option[aria-selected="true"] {
  color: var(--phx-select-accent);
  background: #fbf8fc;
  box-shadow: inset 3px 0 0 var(--phx-select-accent);
}
.phx-select-option[aria-selected="true"]::after {
  content: "✓";
  border-color: var(--phx-select-accent);
  background: var(--phx-select-accent);
}
.phx-select-option:disabled { opacity: .45; }
.phx-select-empty {
  padding: 28px 10px;
  color: #777177;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 820px), (pointer: coarse) {
  .phx-select-sheet {
    display: grid;
    align-items: end;
    justify-items: stretch;
    padding: 0;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
  }
  .phx-select-backdrop {
    background: rgba(14, 14, 16, .52);
    backdrop-filter: blur(3px);
  }
  .phx-select-panel {
    position: relative;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: min(100%, 680px);
    max-height: min(76dvh, 720px);
    margin: 0 auto;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 55px rgba(0, 0, 0, .2);
  }
  .phx-select-sheet-head {
    display: grid;
  }
  .phx-select-search-wrap {
    padding: 12px 18px 4px;
    border-bottom: 0;
  }
  .phx-select-search-wrap::before {
    top: 27px;
    left: 34px;
  }
  .phx-select-search-wrap::after {
    top: 38px;
    left: 44px;
  }
  .phx-select-options {
    gap: 7px;
    padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
  }
  .phx-select-option {
    min-height: 54px;
    height: auto;
    padding: 12px 14px;
    border: 1px solid #e1dee0;
    border-radius: 2px;
    background: #fafafa;
    -webkit-user-select: none;
    user-select: none;
  }
  .phx-select-option[aria-selected="true"] {
    border-color: var(--phx-select-accent);
  }
  .phx-select-search {
    -webkit-user-select: text;
    user-select: text;
  }
  .phx-select-sheet button,
  .phx-select-sheet input {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (min-width: 681px) and (pointer: coarse) {
  .phx-select-panel { margin-bottom: 20px; border-bottom: 1px solid #dedbdd; border-radius: 22px; }
}

@media (max-width: 680px) {
  button.phx-select-trigger { min-height: 46px; padding: 0 13px; font-size: 12px; }
  .phx-select-panel { max-height: min(72dvh, 620px); border-radius: 16px 16px 0 0; }
  .phx-select-sheet-head { min-height: 56px; padding: 10px 14px 9px 16px; }
  .phx-select-sheet-head span { font-size: 8px; }
  .phx-select-sheet-head strong { font-size: 15px; }
  .phx-select-close { width: 32px; height: 32px; font-size: 19px; }
  .phx-select-search-wrap { padding: 9px 14px 3px; }
  .phx-select-search-wrap::before { top: 22px; left: 28px; }
  .phx-select-search-wrap::after { top: 33px; left: 38px; }
  .phx-select-search { min-height: 40px; padding-left: 38px; font-size: 12px; }
  .phx-select-options { gap: 5px; padding: 9px 14px calc(15px + env(safe-area-inset-bottom)); }
  .phx-select-option { min-height: 48px; height: auto; padding: 10px 11px; font-size: 12px; }
  .phx-select-option-label.is-bilingual strong { font-size: 13px; }
  .phx-select-option-label.is-bilingual small { font-size: 10px; line-height: 1.45; }
  .phx-select-option::after { width: 17px; height: 17px; font-size: 10px; }
}
