/* Shared by the public site and the admin app. Native select semantics retain
   Vue value types, form validation, keyboard selection and the top-layer picker.
   Older engines receive the styled control and their native accessible picker. */
:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  min-inline-size: 0;
  max-inline-size: 100%;
  min-block-size: 40px;
  padding: 9px 40px 9px 13px;
  border: 1px solid #405a77;
  border-radius: 10px;
  background-color: #14263b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239bbddd' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  color: #e7f0fc;
  color-scheme: dark;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 #ffffff05;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):hover:not(:disabled) {
  background-color: #1a3049;
  border-color: #6486ad;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):focus {
  border-color: #78b4ed;
  box-shadow: 0 0 0 3px #6ba9ee1a;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):focus-visible {
  outline: 2px solid #a7d4ff;
  outline-offset: 3px;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):disabled {
  background-color: #19283a;
  border-color: #354a60;
  color: #95aac0;
  opacity: 1;
  box-shadow: none;
  cursor: not-allowed;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):is(.invalid, [aria-invalid="true"]) {
  border-color: #e194a3;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select option {
  background-color: #14263b;
  color: #e7f0fc;
  font-weight: 400;
}

:is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select option:disabled { color: #8da2bb; }

/* The picker lives in the browser's top layer: no clipping by scroll panels or
   dialogs, and the browser keeps its built-in viewport collision handling. */
@supports (appearance: base-select) {
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]),
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size])::picker(select) {
    appearance: base-select;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) {
    display: flex;
    align-items: center;
    overflow: visible;
    padding-inline: 13px 12px;
    background-image: none;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) > button {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: start;
    box-shadow: none;
    transform: none;
    transition: none;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) selectedcontent {
    display: block;
    flex: 1 1 0%;
    min-inline-size: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size])::picker-icon {
    content: '';
    flex: 0 0 8px;
    inline-size: 8px;
    block-size: 8px;
    margin: -4px 3px 0 auto;
    border: solid #9bbddd;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(45deg);
    transition: transform .14s ease;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):open {
    background-color: #1b334e;
    border-color: #78b4ed;
    box-shadow: 0 0 0 3px #6ba9ee1a;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]):open::picker-icon {
    transform: translateY(4px) rotate(225deg);
    border-color: #d0e7ff;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size])::picker(select) {
    min-inline-size: anchor-size(width);
    max-inline-size: calc(100vw - 24px);
    max-block-size: min(320px, 55dvh);
    margin-block: 6px;
    padding: 5px;
    border: 1px solid #48627f;
    border-radius: 12px;
    background: #122237;
    color: #e7f0fc;
    color-scheme: dark;
    box-shadow: 0 12px 32px #020b1c66, 0 2px 6px #020b1c33;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #506e90 #122237;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option {
    display: flex;
    align-items: center;
    gap: 16px;
    min-block-size: 38px;
    margin: 2px 0;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #c8d8eb;
    font: inherit;
    font-weight: 400;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option:checked {
    background: #244463;
    border-color: #42658a;
    color: #f0f7ff;
    font-weight: 600;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option:hover:not(:disabled) {
    background: #203b57;
    color: #f0f7ff;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option:focus-visible {
    background: #254866;
    color: #fff;
    outline: 2px solid #8ec7ff;
    outline-offset: -2px;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option::checkmark {
    content: '✓';
    order: 1;
    flex: none;
    margin-inline-start: auto;
    color: #a3d4ff;
    font-size: 14px;
    font-weight: 650;
  }

  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option:disabled {
    background: transparent;
    color: #8198b2;
    cursor: not-allowed;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) {
    min-block-size: 44px;
    font-size: 16px;
  }

  @supports (appearance: base-select) {
    :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) option {
      min-block-size: 44px;
      padding-block: 10px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]),
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size])::picker-icon { transition: none; }
}

@media (forced-colors: active) {
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size]) {
    appearance: auto;
    background-image: none;
    color: ButtonText;
    background-color: ButtonFace;
    border-color: ButtonText;
    box-shadow: none;
  }
  :is(.admin-shell, .dialog-mask, .drawer-mask, .reader-feedback) select:not([multiple]):not([size])::picker(select) { appearance: auto; }
}
