/* Keep the form control and its keyboard semantics across all workspace views. */
:root {
  --menu-ink: #28354b;
  --menu-hover: #f1f4f9;
  --menu-selected: #eaf0ff;
  --menu-accent: #3959b7;
  --menu-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%233959b7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 3 3 7-7'/%3E%3C/svg%3E");
  --menu-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2353657d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}
select:where(:not([multiple],[size]:not([size="1"]))) {
  appearance:none;
  /* All screens supply their own field backgrounds. Keep the disclosure visible on each. */
  background-image:var(--menu-chevron) !important;
  background-position:right 7px center !important;
  background-size:14px !important;
  background-repeat:no-repeat !important;
  padding-inline-end:26px !important;
  cursor:pointer;
}
select:disabled {cursor:default}
.select-menu {
  position:fixed;inset:auto;z-index:10000;box-sizing:border-box;width:max-content;
  max-width:calc(100vw - 16px);max-height:min(330px,55vh);margin:0;
  padding:4px;overflow:auto;overscroll-behavior:contain;
  border:1px solid #dce3ee;border-radius:10px;background:#fff;color:var(--menu-ink);
  box-shadow:0 6px 24px #1c304525;font:500 13px/1.35 Inter,system-ui,sans-serif;
}
.select-menu:focus {outline:none}
.select-menu [role=option], .select-menu .select-group {
  box-sizing:border-box;display:flex;align-items:center;gap:8px;min-height:31px;
  padding:5px 29px 5px 10px;border-radius:6px;overflow-wrap:anywhere;
}
.select-menu .select-group {font-size:11px;font-weight:650;color:#65748a}
.select-menu [role=option] {cursor:pointer}
.select-menu [aria-selected=true] {
  color:var(--menu-accent);background:var(--menu-selected) var(--menu-check) right 8px center / 14px no-repeat;
}
.select-menu [role=option]:is(:hover,[data-active=true]) {background-color:var(--menu-hover)}
.select-menu [aria-selected=true]:is(:hover,[data-active=true]) {background-color:#dfe8fc}
.select-menu [aria-disabled=true] {opacity:.48;cursor:default}
.select-menu [data-mode]::before {
  content:"";width:7px;height:7px;border-radius:50%;flex:none;background:var(--mode-dot);
}
[data-mode=auto],:is(#inbox-mode,#bulk-action) option[value=auto] {--mode-dot:#31876c}
[data-mode=drafts],:is(#inbox-mode,#bulk-action) option[value=drafts] {--mode-dot:#886bb2}
[data-mode=manual],:is(#inbox-mode,#bulk-action) option[value=manual] {--mode-dot:#b47e50}

@supports (appearance:base-select) and selector(::picker(select)) {
  select:where(:not([multiple],[size]:not([size="1"]))),
  select:where(:not([multiple],[size]:not([size="1"])))::picker(select) {appearance:base-select}
  select::picker-icon {display:none}
  select::picker(select) {
    box-sizing:border-box;width:max-content;min-width:anchor-size(width);max-width:calc(100vw - 16px);
    max-height:min(330px,55vh);margin-block:3px;padding:4px;overflow:auto;overscroll-behavior:contain;
    border:1px solid #dce3ee;border-radius:10px;background:#fff;color:var(--menu-ink);
    box-shadow:0 6px 24px #1c304525;font:500 13px/1.35 Inter,system-ui,sans-serif;
  }
  select:where(:not([multiple],[size]:not([size="1"]))) option {
    display:flex;align-items:center;gap:8px;min-height:31px;padding:5px 29px 5px 10px;
    border:none;border-radius:6px;overflow-wrap:anywhere;white-space:normal;cursor:pointer;
    background-color:transparent;color:var(--menu-ink);
  }
  select option::checkmark {display:none}
  select option:checked {color:var(--menu-accent);background:var(--menu-selected) var(--menu-check) right 8px center / 14px no-repeat}
  select option:is(:hover,:focus-visible) {outline:none;background-color:var(--menu-hover)}
  select option:checked:is(:hover,:focus-visible) {background-color:#dfe8fc}
  select option:disabled {opacity:.48;cursor:default}
  :is(#inbox-mode,#bulk-action) option:is([value=auto],[value=manual],[value=drafts])::before {
    content:"";width:7px;height:7px;flex:none;border-radius:50%;background:var(--mode-dot);
  }
}
@media (pointer:coarse) {
  .select-menu [role=option],select:where(:not([multiple],[size]:not([size="1"]))) option {min-height:40px}
}
@media (forced-colors:active) {
  .select-menu [aria-selected=true], select option:checked {color:HighlightText;background:Highlight}
  .select-menu [data-active=true], select option:focus-visible {outline:1px solid Highlight;outline-offset:-2px}
  select {appearance:auto}
}
