  /* ─── Hidden native select ─── */
  select[multiple].ms-upgraded { display: none; }

  /* ─── Trigger ─── */
  .ms-trigger {
    width: 100%;
    border: 1.5px solid #CACACA;
    border-radius: 10px;
    padding: 10px 38px 10px 12px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    transition: border-color .2s, box-shadow .2s;
    overflow: hidden;
    user-select: none;
  }
  .ms-trigger:hover { border-color: #444; }
  .ms-trigger.open {
    border-color: #CACACA;
    /*box-shadow: 0 0 0 3px rgba(124,108,252,0.15);*/
  }

  /* Arrow icon */
  .ms-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    transition: transform .2s, color .2s;
    pointer-events: none;
    line-height: 1;
  }
  .ms-trigger.open .ms-arrow { transform: translateY(-50%) rotate(180deg); color: #7c6cfc; }

  /* Placeholder */
  .ms-placeholder { color: #666666; font-size: 18px; }

  /* Pills */
  .ms-pills {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }
  .ms-pill {
    background: #cbdec3;
    border: 1px solid #738b6955;
    color: #000000;
    border-radius: 5px;
    padding: 2px 7px 2px 8px;
    font-size: 12px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    max-width: 120px;
  }
  .ms-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ms-pill .ms-pill-x {
    flex-shrink: 0;
    cursor: pointer;
    opacity: .6;
    font-size: 13px;
    line-height: 1;
    padding: 0 1px;
  }
  .ms-pill .ms-pill-x:hover { opacity: 1; color: #ff6b6b; }

  /* Count badge (shown when overflow) */
  .ms-count {
    flex-shrink: 0;
    background: #738b69;
    color: #ffffff;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    white-space: nowrap;
  }

  /* ─── Dropdown panel ─── */
  .ms-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #ffffff;
    border: 1.5px solid #CACACA;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
    z-index: 9999;
    overflow: hidden;
  }
  .ms-panel.open { display: block; }

  /* Search */
  .ms-search-wrap {
    padding: 10px 10px 8px;
    border-bottom: 1px solid #CACACA;
    display: none;
  }
  .ms-search-wrap input {
    width: 100%;
    border-radius: 7px;
    padding: 5px;
    color: #e8e8f0;
    font-size: 13px;
    height: 31px;
  }
  .ms-search-wrap input::placeholder { color: #444; }
  .ms-search-wrap input:focus { border-color: #738b69; }

  /* Quick actions */
  .ms-actions {
    display: flex;
    gap: 2px;
    padding: 6px 10px;
    border-bottom: 1px solid #1e1e28;
    display: none;
  }
  .ms-actions button {
    background: none;
    border: none;
    color: #666;
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    transition: background .15s, color .15s;
  }
  .ms-actions button:hover { background: #738b69; color: #ffffff; }

  /* Options */
  .ms-options { overflow-y: auto; }
  .ms-options::-webkit-scrollbar { width: 4px; }
  .ms-options::-webkit-scrollbar-track { background: transparent; }
  .ms-options::-webkit-scrollbar-thumb { background: #2a2a38; border-radius: 2px; }

  .ms-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #444444;
    transition: background .12s, color .12s;
    border-left: 2px solid transparent;
    border-top:1px solid #dddddd;
  }
  .ms-option:hover { background: #cbdec3; color:#000000; }
  .ms-option.selected {
    color: #000000;
    /*border-left-color: #7c6cfc;*/
    background: #cbdec3;
  }

  /* Checkbox variant */
  .ms-box {
    width: 17px; height: 17px;
    border: 1.5px solid #333;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
    position: relative;
  }
  .ms-option.selected .ms-box {
    background: #738b69;
    border-color: #738b69;
  }
  .ms-option.selected .ms-box::after {
    content: '';
    width: 4px; height: 8px;
    border: 1.5px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg) translate(0px, -1px);
    display: block;
  }

  /* Check icon variant */
  .ms-icon {
    width: 17px; height: 17px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: color .15s;
  }
  .ms-option.selected .ms-icon { color: #738b69; }

  /* Empty state */
  .ms-empty {
    padding: 20px;
    text-align: center;
    color: #444;
    font-size: 13px;
    font-family: 'DM Mono', monospace;
  }

  /* Relative wrapper for absolute panel */
  .ms-wrapper {
    position: relative;
  }

  /* Info below */
  .ms-info {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: #333;
    min-height: 16px;
  }
  .ms-info.has-val { color: #7c6cfc88; }

  /* Code block */
  .code-block {
    width: 100%;
    max-width: 900px;
    background: #16161e;
    border: 1px solid #2a2a38;
    border-radius: 16px;
    padding: 28px 28px;
  }
  .code-block h2 {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 16px;
  }
  .code-block pre {
    font-family: 'DM Mono', monospace;
    font-size: 12.5px;
    color: #7c6cfc;
    line-height: 1.8;
    overflow-x: auto;
    white-space: pre;
  }
  .code-block pre .c { color: #444; }
  .code-block pre .k { color: #ff9e6b; }
  .code-block pre .s { color: #a8e6cf; }
  .code-block pre .a { color: #f7d794; }
